OCISDK/OCISDK/Identity/identityClient.cs
/// <summary>
/// Adds the specified user to the specified group and returns a UserGroupMembership object with its own OCID.
/// 
/// After you send your request, the new object's lifecycleState will temporarily be CREATING. 
/// Before using the object, first make sure its lifecycleState has changed to ACTIVE.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Adds the specified user to the specified group and returns a UserGroupMembership object with its own OCID.

After you send your request, the new object's lifecycleState will temporarily be CREATING.
Before using the object, first make sure its lifecycleState has changed to ACTIVE.
Adds the specified user to the specified group and returns a UserGroupMembership object with its own OCID . After you send your request the new object ' s lifecycleState will temporarily be CREATING . Before using the object first make sure its lifecycleState has changed to ACTIVE .
public AddUserToGroupResponse AddUserToGroup(AddUserToGroupRequest request)
        {
            var uri = new Uri($"{GetEndPoint(IdentityServices.UserGroupMemberships, this.Region)}");
            using (var webResponse = this.RestClient.Post(uri, request.AddUserToGroupDetails, new HttpRequestHeaderParam() { OpcRetryToken = request.OpcRetryToken }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new AddUserToGroupResponse()
                {
                    UserGroupMembership = JsonSerializer.Deserialize<UserGroupMembership>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    ETag = webResponse.Headers.Get("ETag")
                };
            }
        }
public AddUserToGroupResponse AddUserToGroup ( AddUserToGroupRequest request ) { var uri = new Uri ( $" { GetEndPoint ( IdentityServices . UserGroupMemberships , this . Region ) } " ) ; using ( var webResponse = this . RestClient . Post ( uri , request . AddUserToGroupDetails , new HttpRequestHeaderParam ( ) { OpcRetryToken = request . OpcRetryToken } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new AddUserToGroupResponse ( ) { UserGroupMembership = JsonSerializer . Deserialize < UserGroupMembership > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , ETag = webResponse . Headers . Get ( " " ) } ; } }
Adds the specified user to the specified group and returns a UserGroupMembership object with its own OCID.
Adds the specified user to the specified group and returns a UserGroupMembership object with its own OCID .
None
request
AddUserToGroupRequest
None