コード例 #1
0
        public async Task <Response <FluidRelayContainerData> > GetAsync(string subscriptionId, string resourceGroup, string fluidRelayServerName, string fluidRelayContainerName, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(resourceGroup, nameof(resourceGroup));
            Argument.AssertNotNullOrEmpty(fluidRelayServerName, nameof(fluidRelayServerName));
            Argument.AssertNotNullOrEmpty(fluidRelayContainerName, nameof(fluidRelayContainerName));

            using var message = CreateGetRequest(subscriptionId, resourceGroup, fluidRelayServerName, fluidRelayContainerName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = FluidRelayContainerData.DeserializeFluidRelayContainerData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
コード例 #2
0
 internal FluidRelayContainerResource(ArmClient client, FluidRelayContainerData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }