Ejemplo n.º 1
0
        public async Task <Response <DiagnosticSettingsCategoryData> > GetAsync(string resourceUri, string name, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(resourceUri, nameof(resourceUri));
            Argument.AssertNotNullOrEmpty(name, nameof(name));

            using var message = CreateGetRequest(resourceUri, name);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = DiagnosticSettingsCategoryData.DeserializeDiagnosticSettingsCategoryData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
 internal DiagnosticSettingsCategoryResource(ArmClient client, DiagnosticSettingsCategoryData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }