Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
package com.microsoft.azure.management.appservice.v2018_02_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.appservice.v2018_02_01.implementation.DeletedSiteInner;
import com.microsoft.azure.arm.model.Indexable;
import com.microsoft.azure.arm.model.Refreshable;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.appservice.v2018_02_01.implementation.CertificateRegistrationManager;
import com.microsoft.azure.management.appservice.v2018_02_01.implementation.DeletedSiteInner;

/**
* Type representing DeletedSite.
*/
public interface DeletedSite extends HasInner<DeletedSiteInner>, HasManager<CertificateRegistrationManager> {
public interface DeletedSite extends HasInner<DeletedSiteInner>, Indexable, Refreshable<DeletedSite>, HasManager<CertificateRegistrationManager> {
/**
* @return the deletedSiteId value.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,33 @@
package com.microsoft.azure.management.appservice.v2018_02_01;

import rx.Observable;
import com.microsoft.azure.management.appservice.v2018_02_01.implementation.DeletedWebAppsInner;
import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.appservice.v2018_02_01.DeletedSite;

/**
* Type representing DeletedWebApps.
*/
public interface DeletedWebApps extends HasInner<DeletedWebAppsInner> {
public interface DeletedWebApps {
/**
* Get deleted app for a subscription at location.
* Get deleted app for a subscription at location.
*
* @param location the String value
* @param deletedSiteId The numeric ID of the deleted app, e.g. 12345
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<DeletedSite> getDeletedWebAppByLocationAsync(String location, String deletedSiteId);

/**
* Get all deleted apps for a subscription at location.
* Get all deleted apps for a subscription at location.
*
* @param location the String value
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<DeletedSite> listByLocationAsync(final String location);

/**
* Get all deleted apps for a subscription.
* Get all deleted apps for a subscription.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,35 @@
package com.microsoft.azure.management.appservice.v2018_02_01.implementation;

import com.microsoft.azure.management.appservice.v2018_02_01.DeletedSite;
import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl;
import rx.Observable;

class DeletedSiteImpl extends WrapperImpl<DeletedSiteInner> implements DeletedSite {
class DeletedSiteImpl extends IndexableRefreshableWrapperImpl<DeletedSite, DeletedSiteInner> implements DeletedSite {
private final CertificateRegistrationManager manager;
DeletedSiteImpl(DeletedSiteInner inner, CertificateRegistrationManager manager) {
super(inner);
private String location;
private String deletedSiteId;

DeletedSiteImpl(DeletedSiteInner inner, CertificateRegistrationManager manager) {
super(null, inner);
this.manager = manager;
// set resource ancestor and positional variables
this.location = IdParsingUtils.getValueFromIdByName(inner.id(), "locations");
this.deletedSiteId = IdParsingUtils.getValueFromIdByName(inner.id(), "deletedSites");
}

@Override
public CertificateRegistrationManager manager() {
return this.manager;
}

@Override
protected Observable<DeletedSiteInner> getInnerAsync() {
DeletedWebAppsInner client = this.manager().inner().deletedWebApps();
return client.getDeletedWebAppByLocationAsync(this.location, this.deletedSiteId);
}



@Override
public Integer deletedSiteId() {
return this.inner().deletedSiteId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.appservice.v2018_02_01.DeletedWebApps;
import rx.functions.Func1;
import rx.Observable;
import com.microsoft.azure.Page;
import rx.functions.Func1;
import com.microsoft.azure.management.appservice.v2018_02_01.DeletedSite;
import com.microsoft.azure.Page;

class DeletedWebAppsImpl extends WrapperImpl<DeletedWebAppsInner> implements DeletedWebApps {
private final CertificateRegistrationManager manager;
Expand All @@ -28,6 +28,47 @@ public CertificateRegistrationManager manager() {
return this.manager;
}

private DeletedSiteImpl wrapDeletedSiteModel(DeletedSiteInner inner) {
return new DeletedSiteImpl(inner, manager());
}

private Observable<DeletedSiteInner> getDeletedSiteInnerUsingDeletedWebAppsInnerAsync(String id) {
String location = IdParsingUtils.getValueFromIdByName(id, "locations");
String deletedSiteId = IdParsingUtils.getValueFromIdByName(id, "deletedSites");
DeletedWebAppsInner client = this.inner();
return client.getDeletedWebAppByLocationAsync(location, deletedSiteId);
}

@Override
public Observable<DeletedSite> getDeletedWebAppByLocationAsync(String location, String deletedSiteId) {
DeletedWebAppsInner client = this.inner();
return client.getDeletedWebAppByLocationAsync(location, deletedSiteId)
.map(new Func1<DeletedSiteInner, DeletedSite>() {
@Override
public DeletedSite call(DeletedSiteInner inner) {
return wrapDeletedSiteModel(inner);
}
});
}

@Override
public Observable<DeletedSite> listByLocationAsync(final String location) {
DeletedWebAppsInner client = this.inner();
return client.listByLocationAsync(location)
.flatMapIterable(new Func1<Page<DeletedSiteInner>, Iterable<DeletedSiteInner>>() {
@Override
public Iterable<DeletedSiteInner> call(Page<DeletedSiteInner> page) {
return page.items();
}
})
.map(new Func1<DeletedSiteInner, DeletedSite>() {
@Override
public DeletedSite call(DeletedSiteInner inner) {
return wrapDeletedSiteModel(inner);
}
});
}

@Override
public Observable<DeletedSite> listAsync() {
DeletedWebAppsInner client = this.inner();
Expand Down
Loading