Exemple #1
0
        GatewayCustomDomainResource IOperationSource <GatewayCustomDomainResource> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = GatewayCustomDomainResourceData.DeserializeGatewayCustomDomainResourceData(document.RootElement);

            return(new GatewayCustomDomainResource(_client, data));
        }
Exemple #2
0
        public async Task <Response <GatewayCustomDomainResourceData> > GetAsync(string subscriptionId, string resourceGroupName, string serviceName, string gatewayName, string domainName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName));
            Argument.AssertNotNullOrEmpty(serviceName, nameof(serviceName));
            Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName));
            Argument.AssertNotNullOrEmpty(domainName, nameof(domainName));

            using var message = CreateGetRequest(subscriptionId, resourceGroupName, serviceName, gatewayName, domainName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            {
                GatewayCustomDomainResourceData value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                value = GatewayCustomDomainResourceData.DeserializeGatewayCustomDomainResourceData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }