OCISDK/OCISDK/Identity/identityClient.cs
/// <summary>
/// Updates the specified policy. You can update the description or the policy statements themselves.
/// Policy changes take effect typically within 10 seconds.
/// </summary>
/// <param name="updatePolicyRequest"></param>
/// <returns></returns>
Updates the specified policy. You can update the description or the policy statements themselves.
Policy changes take effect typically within 10 seconds.
Updates the specified policy . You can update the description or the policy statements themselves . Policy changes take effect typically within 10 seconds .
public UpdatePolicyResponse UpdatePolicy(UpdatePolicyRequest updatePolicyRequest)
        {
            var uri = new Uri($"{GetEndPoint(IdentityServices.Policiy, this.Region)}/{updatePolicyRequest.PolicyId}");
            using (var webResponse = this.RestClient.Put(uri, updatePolicyRequest.UpdatePolicyDetails))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new UpdatePolicyResponse()
                {
                    Policy = JsonSerializer.Deserialize<Policy>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    ETag = webResponse.Headers.Get("etag")
                };
            }
        }
public UpdatePolicyResponse UpdatePolicy ( UpdatePolicyRequest updatePolicyRequest ) { var uri = new Uri ( $" { GetEndPoint ( IdentityServices . Policiy , this . Region ) } / { updatePolicyRequest . PolicyId } " ) ; using ( var webResponse = this . RestClient . Put ( uri , updatePolicyRequest . UpdatePolicyDetails ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new UpdatePolicyResponse ( ) { Policy = JsonSerializer . Deserialize < Policy > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , ETag = webResponse . Headers . Get ( " " ) } ; } }
Updates the specified policy.
Updates the specified policy .
None
updatePolicyRequest
UpdatePolicyRequest
None