Esempio n. 1
0
 internal OSVersion(ArmResource options, OSVersionData resource) : base(options, resource.Id)
 {
     HasData            = true;
     _data              = resource;
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _cloudServiceOperatingSystemsRestClient = new CloudServiceOperatingSystemsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
 }
        public async Task <Response <OSVersionData> > GetOSVersionAsync(string subscriptionId, string location, string osVersionName, CancellationToken cancellationToken = default)
        {
            if (subscriptionId == null)
            {
                throw new ArgumentNullException(nameof(subscriptionId));
            }
            if (location == null)
            {
                throw new ArgumentNullException(nameof(location));
            }
            if (osVersionName == null)
            {
                throw new ArgumentNullException(nameof(osVersionName));
            }

            using var message = CreateGetOSVersionRequest(subscriptionId, location, osVersionName);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = OSVersionData.DeserializeOSVersionData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
Esempio n. 3
0
        internal OSVersion(ArmResource options, OSVersionData data) : base(options, data.Id)
        {
            HasData            = true;
            _data              = data;
            _clientDiagnostics = new ClientDiagnostics(ClientOptions);
            _cloudServiceOperatingSystemsRestClient = new CloudServiceOperatingSystemsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
#if DEBUG
            ValidateResourceId(Id);
#endif
        }
 internal OSVersion(ArmClient client, OSVersionData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }