OCISDK/OCISDK/Identity/identityClient.cs
/// <summary>
/// Creates a new tag namespace in the specified compartment.
/// You must specify the compartment ID in the request object (remember that the tenancy is simply the root compartment).
/// </summary>
/// <param name="createRequest"></param>
/// <returns></returns>
Creates a new tag namespace in the specified compartment.
You must specify the compartment ID in the request object (remember that the tenancy is simply the root compartment).
Creates a new tag namespace in the specified compartment . You must specify the compartment ID in the request object ( remember that the tenancy is simply the root compartment ) .
public CreateTagNamespaceResponse CreateTagNamespace(CreateTagNamespaceRequest createRequest)
        {
            var uri = new Uri(GetEndPoint(IdentityServices.TagNamespaces, this.Region));
            using (var webResponse = this.RestClient.Post(uri, createRequest.CreateTagNamespaceDetails, new HttpRequestHeaderParam() { OpcRetryToken = createRequest.OpcRetryToken }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new CreateTagNamespaceResponse()
                {
                    TagNamespace = JsonSerializer.Deserialize<TagNamespace>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id")
                };
            }
        }
public CreateTagNamespaceResponse CreateTagNamespace ( CreateTagNamespaceRequest createRequest ) { var uri = new Uri ( GetEndPoint ( IdentityServices . TagNamespaces , this . Region ) ) ; using ( var webResponse = this . RestClient . Post ( uri , createRequest . CreateTagNamespaceDetails , new HttpRequestHeaderParam ( ) { OpcRetryToken = createRequest . OpcRetryToken } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new CreateTagNamespaceResponse ( ) { TagNamespace = JsonSerializer . Deserialize < TagNamespace > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) } ; } }
Creates a new tag namespace in the specified compartment.
Creates a new tag namespace in the specified compartment .
None
createRequest
CreateTagNamespaceRequest
None