internal DeletedSite(ArmResource options, DeletedSiteData resource) : base(options, resource.Id)
 {
     HasData            = true;
     _data              = resource;
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _globalRestClient  = new GlobalRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
 }
示例#2
0
        public async Task <Response <DeletedSiteData> > GetDeletedWebAppAsync(string subscriptionId, string deletedSiteId, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId));
            Argument.AssertNotNullOrEmpty(deletedSiteId, nameof(deletedSiteId));

            using var message = CreateGetDeletedWebAppRequest(subscriptionId, deletedSiteId);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

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

                value = DeletedSiteData.DeserializeDeletedSiteData(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
示例#3
0
 internal DeletedSite(ArmClient client, DeletedSiteData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }