Skip to content
Closed
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,19 +9,23 @@
package com.microsoft.azure.management.billing.v2018_11_01_preview;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.billing.v2018_11_01_preview.implementation.BillingAccountInner;
import com.microsoft.azure.arm.model.Indexable;
import com.microsoft.azure.arm.model.Updatable;
import com.microsoft.azure.arm.model.Appliable;
import com.microsoft.azure.arm.model.Refreshable;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.billing.v2018_11_01_preview.implementation.BillingManager;
import com.microsoft.azure.management.billing.v2018_11_01_preview.implementation.BillingAccountInner;
import com.microsoft.azure.management.billing.v2018_11_01_preview.implementation.BillingProfileInner;
import java.util.List;
import com.microsoft.azure.management.billing.v2018_11_01_preview.implementation.BillingProfileInner;
import com.microsoft.azure.management.billing.v2018_11_01_preview.implementation.DepartmentInner;
import com.microsoft.azure.management.billing.v2018_11_01_preview.implementation.EnrollmentAccountInner;
import com.microsoft.azure.management.billing.v2018_11_01_preview.implementation.InvoiceSectionInner;

/**
* Type representing BillingAccount.
*/
public interface BillingAccount extends HasInner<BillingAccountInner>, HasManager<BillingManager> {
public interface BillingAccount extends HasInner<BillingAccountInner>, Indexable, Updatable<BillingAccount.Update>, Refreshable<BillingAccount>, HasManager<BillingManager> {
/**
* @return the accountType value.
*/
Expand All @@ -35,7 +39,7 @@ public interface BillingAccount extends HasInner<BillingAccountInner>, HasManage
/**
* @return the billingProfiles value.
*/
List<BillingProfileInner> billingProfiles();
List<BillingProfile> billingProfiles();

/**
* @return the company value.
Expand All @@ -50,7 +54,7 @@ public interface BillingAccount extends HasInner<BillingAccountInner>, HasManage
/**
* @return the departments value.
*/
List<DepartmentInner> departments();
List<Department> departments();

/**
* @return the displayName value.
Expand All @@ -60,7 +64,7 @@ public interface BillingAccount extends HasInner<BillingAccountInner>, HasManage
/**
* @return the enrollmentAccounts value.
*/
List<EnrollmentAccountInner> enrollmentAccounts();
List<EnrollmentAccount> enrollmentAccounts();

/**
* @return the enrollmentDetails value.
Expand All @@ -80,7 +84,7 @@ public interface BillingAccount extends HasInner<BillingAccountInner>, HasManage
/**
* @return the invoiceSections value.
*/
List<InvoiceSectionInner> invoiceSections();
List<InvoiceSection> invoiceSections();

/**
* @return the name value.
Expand All @@ -92,4 +96,75 @@ public interface BillingAccount extends HasInner<BillingAccountInner>, HasManage
*/
String type();

/**
* The template for a BillingAccount update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<BillingAccount>, UpdateStages.WithAddress, UpdateStages.WithBillingProfiles, UpdateStages.WithDepartments, UpdateStages.WithEnrollmentAccounts, UpdateStages.WithInvoiceSections {
}

/**
* Grouping of BillingAccount update stages.
*/
interface UpdateStages {
/**
* The stage of the billingaccount update allowing to specify Address.
*/
interface WithAddress {
/**
* Specifies address.
* @param address The address associated with billing account
* @return the next update stage
*/
Update withAddress(Address address);
}

/**
* The stage of the billingaccount update allowing to specify BillingProfiles.
*/
interface WithBillingProfiles {
/**
* Specifies billingProfiles.
* @param billingProfiles The billing profiles associated to the billing account. By default this is not populated, unless it's specified in $expand
* @return the next update stage
*/
Update withBillingProfiles(List<BillingProfileInner> billingProfiles);
}

/**
* The stage of the billingaccount update allowing to specify Departments.
*/
interface WithDepartments {
/**
* Specifies departments.
* @param departments The departments associated to the enrollment
* @return the next update stage
*/
Update withDepartments(List<DepartmentInner> departments);
}

/**
* The stage of the billingaccount update allowing to specify EnrollmentAccounts.
*/
interface WithEnrollmentAccounts {
/**
* Specifies enrollmentAccounts.
* @param enrollmentAccounts The accounts associated to the enrollment
* @return the next update stage
*/
Update withEnrollmentAccounts(List<EnrollmentAccountInner> enrollmentAccounts);
}

/**
* The stage of the billingaccount update allowing to specify InvoiceSections.
*/
interface WithInvoiceSections {
/**
* Specifies invoiceSections.
* @param invoiceSections The invoice sections associated to the billing account. By default this is not populated, unless it's specified in $expand
* @return the next update stage
*/
Update withInvoiceSections(List<InvoiceSectionInner> invoiceSections);
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.billing.v2018_11_01_preview;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Defines headers for Update operation.
*/
public class BillingAccountsUpdateHeaders {
/**
* GET this URL to retrieve the status of the asynchronous operation.
*/
@JsonProperty(value = "Location")
private String location;

/**
* The amount of delay to use while the status of the operation is checked.
* The value is expressed in seconds.
*/
@JsonProperty(value = "Retry-After")
private String retryAfter;

/**
* Get gET this URL to retrieve the status of the asynchronous operation.
*
* @return the location value
*/
public String location() {
return this.location;
}

/**
* Set gET this URL to retrieve the status of the asynchronous operation.
*
* @param location the location value to set
* @return the BillingAccountsUpdateHeaders object itself.
*/
public BillingAccountsUpdateHeaders withLocation(String location) {
this.location = location;
return this;
}

/**
* Get the amount of delay to use while the status of the operation is checked. The value is expressed in seconds.
*
* @return the retryAfter value
*/
public String retryAfter() {
return this.retryAfter;
}

/**
* Set the amount of delay to use while the status of the operation is checked. The value is expressed in seconds.
*
* @param retryAfter the retryAfter value to set
* @return the BillingAccountsUpdateHeaders object itself.
*/
public BillingAccountsUpdateHeaders withRetryAfter(String retryAfter) {
this.retryAfter = retryAfter;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,75 @@
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*
*/

package com.microsoft.azure.management.billing.v2018_11_01_preview.implementation;

import com.microsoft.azure.management.billing.v2018_11_01_preview.BillingAccount;
import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl;
import rx.Observable;
import com.microsoft.azure.management.billing.v2018_11_01_preview.Address;
import java.util.List;
import com.microsoft.azure.management.billing.v2018_11_01_preview.Enrollment;

class BillingAccountImpl extends WrapperImpl<BillingAccountInner> implements BillingAccount {
import java.util.ArrayList;
import com.microsoft.azure.management.billing.v2018_11_01_preview.BillingProfile;
import com.microsoft.azure.management.billing.v2018_11_01_preview.Department;
import com.microsoft.azure.management.billing.v2018_11_01_preview.EnrollmentAccount;
import com.microsoft.azure.management.billing.v2018_11_01_preview.InvoiceSection;

class BillingAccountImpl extends CreatableUpdatableImpl<BillingAccount, BillingAccountInner, BillingAccountImpl> implements BillingAccount, BillingAccount.Update {
private String billingAccountName;
private final BillingManager manager;

BillingAccountImpl(String name, BillingManager manager) {
super(name, new BillingAccountInner());
this.manager = manager;
// Set resource name
this.billingAccountName = name;
//
}

BillingAccountImpl(BillingAccountInner inner, BillingManager manager) {
super(inner);
super(inner.name(), inner);
this.manager = manager;
// Set resource name
this.billingAccountName = inner.name();
// set resource ancestor and positional variables
this.billingAccountName = IdParsingUtils.getValueFromIdByName(inner.id(), "billingAccounts");
// set other parameters for create and update
}

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

@Override
public Observable<BillingAccount> createResourceAsync() {
BillingAccountsInner client = this.manager().inner().billingAccounts();
return null; // NOP createResourceAsync implementation as create is not supported
}

@Override
public Observable<BillingAccount> updateResourceAsync() {
BillingAccountsInner client = this.manager().inner().billingAccounts();
return client.updateAsync(this.billingAccountName, this.inner())
.map(innerToFluentMap(this));
}

@Override
protected Observable<BillingAccountInner> getInnerAsync() {
BillingAccountsInner client = this.manager().inner().billingAccounts();
return client.getAsync(this.billingAccountName);
}

@Override
public boolean isInCreateMode() {
return this.inner().id() == null;
}


@Override
public String accountType() {
return this.inner().accountType();
Expand All @@ -37,8 +84,14 @@ public Address address() {
}

@Override
public List<BillingProfileInner> billingProfiles() {
return this.inner().billingProfiles();
public List<BillingProfile> billingProfiles() {
List<BillingProfile> lst = new ArrayList<BillingProfile>();
if (this.inner().billingProfiles() != null) {
for (BillingProfileInner inner : this.inner().billingProfiles()) {
lst.add( new BillingProfileImpl(inner, manager()));
}
}
return lst;
}

@Override
Expand All @@ -52,8 +105,14 @@ public String country() {
}

@Override
public List<DepartmentInner> departments() {
return this.inner().departments();
public List<Department> departments() {
List<Department> lst = new ArrayList<Department>();
if (this.inner().departments() != null) {
for (DepartmentInner inner : this.inner().departments()) {
lst.add( new DepartmentImpl(inner, manager()));
}
}
return lst;
}

@Override
Expand All @@ -62,8 +121,14 @@ public String displayName() {
}

@Override
public List<EnrollmentAccountInner> enrollmentAccounts() {
return this.inner().enrollmentAccounts();
public List<EnrollmentAccount> enrollmentAccounts() {
List<EnrollmentAccount> lst = new ArrayList<EnrollmentAccount>();
if (this.inner().enrollmentAccounts() != null) {
for (EnrollmentAccountInner inner : this.inner().enrollmentAccounts()) {
lst.add( new EnrollmentAccountImpl(inner, manager()));
}
}
return lst;
}

@Override
Expand All @@ -82,8 +147,14 @@ public String id() {
}

@Override
public List<InvoiceSectionInner> invoiceSections() {
return this.inner().invoiceSections();
public List<InvoiceSection> invoiceSections() {
List<InvoiceSection> lst = new ArrayList<InvoiceSection>();
if (this.inner().invoiceSections() != null) {
for (InvoiceSectionInner inner : this.inner().invoiceSections()) {
lst.add( new InvoiceSectionImpl(inner, manager()));
}
}
return lst;
}

@Override
Expand All @@ -96,4 +167,34 @@ public String type() {
return this.inner().type();
}

@Override
public BillingAccountImpl withAddress(Address address) {
this.inner().withAddress(address);
return this;
}

@Override
public BillingAccountImpl withBillingProfiles(List<BillingProfileInner> billingProfiles) {
this.inner().withBillingProfiles(billingProfiles);
return this;
}

@Override
public BillingAccountImpl withDepartments(List<DepartmentInner> departments) {
this.inner().withDepartments(departments);
return this;
}

@Override
public BillingAccountImpl withEnrollmentAccounts(List<EnrollmentAccountInner> enrollmentAccounts) {
this.inner().withEnrollmentAccounts(enrollmentAccounts);
return this;
}

@Override
public BillingAccountImpl withInvoiceSections(List<InvoiceSectionInner> invoiceSections) {
this.inner().withInvoiceSections(invoiceSections);
return this;
}

}
Loading