Skip to content

Latest commit

 

History

History
224 lines (143 loc) · 6.9 KB

File metadata and controls

224 lines (143 loc) · 6.9 KB

\UserAppRoleAssignmentApi

All URIs are relative to https://localhost:9200/graph

Method HTTP request Description
UserCreateAppRoleAssignments Post /v1.0/users/{user-id}/appRoleAssignments Grant an appRoleAssignment to a user
UserDeleteAppRoleAssignments Delete /v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id} Delete the appRoleAssignment from a user
UserListAppRoleAssignments Get /v1.0/users/{user-id}/appRoleAssignments Get appRoleAssignments from a user

UserCreateAppRoleAssignments

AppRoleAssignment UserCreateAppRoleAssignments(ctx, userId).AppRoleAssignment(appRoleAssignment).Execute()

Grant an appRoleAssignment to a user

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opencloud-eu/libre-graph-api-go"
)

func main() {
	userId := "userId_example" // string | key: id of user
	appRoleAssignment := *openapiclient.NewAppRoleAssignment("AppRoleId_example", "PrincipalId_example", "ResourceId_example") // AppRoleAssignment | New app role assignment value

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.UserAppRoleAssignmentApi.UserCreateAppRoleAssignments(context.Background(), userId).AppRoleAssignment(appRoleAssignment).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserAppRoleAssignmentApi.UserCreateAppRoleAssignments``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UserCreateAppRoleAssignments`: AppRoleAssignment
	fmt.Fprintf(os.Stdout, "Response from `UserAppRoleAssignmentApi.UserCreateAppRoleAssignments`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
userId string key: id of user

Other Parameters

Other parameters are passed through a pointer to a apiUserCreateAppRoleAssignmentsRequest struct via the builder pattern

Name Type Description Notes

appRoleAssignment | AppRoleAssignment | New app role assignment value |

Return type

AppRoleAssignment

Authorization

openId, basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserDeleteAppRoleAssignments

UserDeleteAppRoleAssignments(ctx, userId, appRoleAssignmentId).IfMatch(ifMatch).Execute()

Delete the appRoleAssignment from a user

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opencloud-eu/libre-graph-api-go"
)

func main() {
	userId := "userId_example" // string | key: id of user
	appRoleAssignmentId := "appRoleAssignmentId_example" // string | key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon.
	ifMatch := "ifMatch_example" // string | ETag (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.UserAppRoleAssignmentApi.UserDeleteAppRoleAssignments(context.Background(), userId, appRoleAssignmentId).IfMatch(ifMatch).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserAppRoleAssignmentApi.UserDeleteAppRoleAssignments``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
userId string key: id of user
appRoleAssignmentId string key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon.

Other Parameters

Other parameters are passed through a pointer to a apiUserDeleteAppRoleAssignmentsRequest struct via the builder pattern

Name Type Description Notes

ifMatch | string | ETag |

Return type

(empty response body)

Authorization

openId, basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserListAppRoleAssignments

CollectionOfAppRoleAssignments UserListAppRoleAssignments(ctx, userId).Execute()

Get appRoleAssignments from a user

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opencloud-eu/libre-graph-api-go"
)

func main() {
	userId := "userId_example" // string | key: id of user

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.UserAppRoleAssignmentApi.UserListAppRoleAssignments(context.Background(), userId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UserAppRoleAssignmentApi.UserListAppRoleAssignments``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UserListAppRoleAssignments`: CollectionOfAppRoleAssignments
	fmt.Fprintf(os.Stdout, "Response from `UserAppRoleAssignmentApi.UserListAppRoleAssignments`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
userId string key: id of user

Other Parameters

Other parameters are passed through a pointer to a apiUserListAppRoleAssignmentsRequest struct via the builder pattern

Name Type Description Notes

Return type

CollectionOfAppRoleAssignments

Authorization

openId, basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]