Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Initial phone number redesign
  • Loading branch information
Minnie Liu committed Feb 11, 2021
commit f2fe9e2f83f228a4ec3f141295b51a03bcceb77b

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ public PhoneNumberClientBuilder serviceVersion(PhoneNumberServiceVersion version
* @return {@link PhoneNumberClient} instance
*/
public PhoneNumberClient buildClient() {
return new PhoneNumberClient(this.buildAsyncClient());
this.validateRequiredFields();

if (this.version != null) {
logger.info("Build client for service version" + this.version.getVersion());
}

return new PhoneNumberClient(this.createPhoneNumberAdminClient());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ public HttpPipeline getHttpPipeline() {
return this.httpPipeline;
}

/** The PhoneNumberAdministrationsImpl object to access its operations. */
private final PhoneNumberAdministrationsImpl phoneNumberAdministrations;
/** The PhoneNumbersImpl object to access its operations. */
private final PhoneNumbersImpl phoneNumbers;

/**
* Gets the PhoneNumberAdministrationsImpl object to access its operations.
* Gets the PhoneNumbersImpl object to access its operations.
*
* @return the PhoneNumberAdministrationsImpl object.
* @return the PhoneNumbersImpl object.
*/
public PhoneNumberAdministrationsImpl getPhoneNumberAdministrations() {
return this.phoneNumberAdministrations;
public PhoneNumbersImpl getPhoneNumbers() {
return this.phoneNumbers;
}

/** Initializes an instance of PhoneNumberAdminClient client. */
Expand All @@ -77,7 +77,7 @@ public PhoneNumberAdministrationsImpl getPhoneNumberAdministrations() {
PhoneNumberAdminClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.apiVersion = "2020-07-20-preview1";
this.phoneNumberAdministrations = new PhoneNumberAdministrationsImpl(this);
this.apiVersion = "2020-11-01-preview3";
this.phoneNumbers = new PhoneNumbersImpl(this);
}
}

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,94 @@

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.time.OffsetDateTime;

/** The AcquiredPhoneNumber model. */
@Fluent
public final class AcquiredPhoneNumber {
/*
* String of the E.164 format of the phone number
* The id, this is the same as the phone number in E.164 format.
*/
@JsonProperty(value = "id", required = true)
private String id;

/*
* The phoneNumber in E.164 format.
*/
@JsonProperty(value = "phoneNumber", required = true)
private String phoneNumber;

/*
* The set of all acquired capabilities of the phone number.
* The ISO 3166-2 country code of the country that the phone number belongs
* to.
*/
@JsonProperty(value = "countryCode", required = true)
private String countryCode;

/*
* The type of the phone number.
*/
@JsonProperty(value = "acquiredCapabilities", required = true)
private List<Capability> acquiredCapabilities;
@JsonProperty(value = "phoneNumberType", required = true)
private PhoneNumberType phoneNumberType;

/*
* The set of all available capabilities that can be acquired for this
* phone number.
* The assignment type of the phone number, people or application.
*/
@JsonProperty(value = "availableCapabilities", required = true)
private List<Capability> availableCapabilities;
@JsonProperty(value = "assignmentType", required = true)
private PhoneNumberAssignmentType assignmentType;

/*
* The assignment status of the phone number. Conveys what type of entity
* the number is assigned to.
* The purchase date of the phone number.
*/
@JsonProperty(value = "assignmentStatus")
private AssignmentStatus assignmentStatus;
@JsonProperty(value = "purchaseDate", required = true)
private OffsetDateTime purchaseDate;

/*
* The name of the place of the phone number.
* The phone number's capabilities.
*/
@JsonProperty(value = "placeName")
private String placeName;
@JsonProperty(value = "capabilities", required = true)
private PhoneNumberCapabilities capabilities;

/*
* The activation state of the phone number. Can be "Activated",
* "AssignmentPending", "AssignmentFailed", "UpdatePending", "UpdateFailed"
* The webhook for receiving incoming events.
*/
@JsonProperty(value = "callbackUri", required = true)
private String callbackUri;

/*
* The application id the number has been assigned to.
*/
@JsonProperty(value = "applicationId", required = true)
private String applicationId;

/*
* The monthly cost of the phone number.
*/
@JsonProperty(value = "cost", required = true)
private PhoneNumberCost cost;

/**
* Get the id property: The id, this is the same as the phone number in E.164 format.
*
* @return the id value.
*/
@JsonProperty(value = "activationState")
private ActivationState activationState;
public String getId() {
return this.id;
}

/**
* Get the phoneNumber property: String of the E.164 format of the phone number.
* Set the id property: The id, this is the same as the phone number in E.164 format.
*
* @param id the id value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setId(String id) {
this.id = id;
return this;
}

/**
* Get the phoneNumber property: The phoneNumber in E.164 format.
*
* @return the phoneNumber value.
*/
Expand All @@ -60,7 +102,7 @@ public String getPhoneNumber() {
}

/**
* Set the phoneNumber property: String of the E.164 format of the phone number.
* Set the phoneNumber property: The phoneNumber in E.164 format.
*
* @param phoneNumber the phoneNumber value to set.
* @return the AcquiredPhoneNumber object itself.
Expand All @@ -71,108 +113,162 @@ public AcquiredPhoneNumber setPhoneNumber(String phoneNumber) {
}

/**
* Get the acquiredCapabilities property: The set of all acquired capabilities of the phone number.
* Get the countryCode property: The ISO 3166-2 country code of the country that the phone number belongs to.
*
* @return the countryCode value.
*/
public String getCountryCode() {
return this.countryCode;
}

/**
* Set the countryCode property: The ISO 3166-2 country code of the country that the phone number belongs to.
*
* @param countryCode the countryCode value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setCountryCode(String countryCode) {
this.countryCode = countryCode;
return this;
}

/**
* Get the phoneNumberType property: The type of the phone number.
*
* @return the phoneNumberType value.
*/
public PhoneNumberType getPhoneNumberType() {
return this.phoneNumberType;
}

/**
* Set the phoneNumberType property: The type of the phone number.
*
* @param phoneNumberType the phoneNumberType value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setPhoneNumberType(PhoneNumberType phoneNumberType) {
this.phoneNumberType = phoneNumberType;
return this;
}

/**
* Get the assignmentType property: The assignment type of the phone number, people or application.
*
* @return the assignmentType value.
*/
public PhoneNumberAssignmentType getAssignmentType() {
return this.assignmentType;
}

/**
* Set the assignmentType property: The assignment type of the phone number, people or application.
*
* @param assignmentType the assignmentType value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setAssignmentType(PhoneNumberAssignmentType assignmentType) {
this.assignmentType = assignmentType;
return this;
}

/**
* Get the purchaseDate property: The purchase date of the phone number.
*
* @return the acquiredCapabilities value.
* @return the purchaseDate value.
*/
public List<Capability> getAcquiredCapabilities() {
return this.acquiredCapabilities;
public OffsetDateTime getPurchaseDate() {
return this.purchaseDate;
}

/**
* Set the acquiredCapabilities property: The set of all acquired capabilities of the phone number.
* Set the purchaseDate property: The purchase date of the phone number.
*
* @param acquiredCapabilities the acquiredCapabilities value to set.
* @param purchaseDate the purchaseDate value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setAcquiredCapabilities(List<Capability> acquiredCapabilities) {
this.acquiredCapabilities = acquiredCapabilities;
public AcquiredPhoneNumber setPurchaseDate(OffsetDateTime purchaseDate) {
this.purchaseDate = purchaseDate;
return this;
}

/**
* Get the availableCapabilities property: The set of all available capabilities that can be acquired for this phone
* number.
* Get the capabilities property: The phone number's capabilities.
*
* @return the availableCapabilities value.
* @return the capabilities value.
*/
public List<Capability> getAvailableCapabilities() {
return this.availableCapabilities;
public PhoneNumberCapabilities getCapabilities() {
return this.capabilities;
}

/**
* Set the availableCapabilities property: The set of all available capabilities that can be acquired for this phone
* number.
* Set the capabilities property: The phone number's capabilities.
*
* @param availableCapabilities the availableCapabilities value to set.
* @param capabilities the capabilities value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setAvailableCapabilities(List<Capability> availableCapabilities) {
this.availableCapabilities = availableCapabilities;
public AcquiredPhoneNumber setCapabilities(PhoneNumberCapabilities capabilities) {
this.capabilities = capabilities;
return this;
}

/**
* Get the assignmentStatus property: The assignment status of the phone number. Conveys what type of entity the
* number is assigned to.
* Get the callbackUri property: The webhook for receiving incoming events.
*
* @return the assignmentStatus value.
* @return the callbackUri value.
*/
public AssignmentStatus getAssignmentStatus() {
return this.assignmentStatus;
public String getCallbackUri() {
return this.callbackUri;
}

/**
* Set the assignmentStatus property: The assignment status of the phone number. Conveys what type of entity the
* number is assigned to.
* Set the callbackUri property: The webhook for receiving incoming events.
*
* @param assignmentStatus the assignmentStatus value to set.
* @param callbackUri the callbackUri value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setAssignmentStatus(AssignmentStatus assignmentStatus) {
this.assignmentStatus = assignmentStatus;
public AcquiredPhoneNumber setCallbackUri(String callbackUri) {
this.callbackUri = callbackUri;
return this;
}

/**
* Get the placeName property: The name of the place of the phone number.
* Get the applicationId property: The application id the number has been assigned to.
*
* @return the placeName value.
* @return the applicationId value.
*/
public String getPlaceName() {
return this.placeName;
public String getApplicationId() {
return this.applicationId;
}

/**
* Set the placeName property: The name of the place of the phone number.
* Set the applicationId property: The application id the number has been assigned to.
*
* @param placeName the placeName value to set.
* @param applicationId the applicationId value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setPlaceName(String placeName) {
this.placeName = placeName;
public AcquiredPhoneNumber setApplicationId(String applicationId) {
this.applicationId = applicationId;
return this;
}

/**
* Get the activationState property: The activation state of the phone number. Can be "Activated",
* "AssignmentPending", "AssignmentFailed", "UpdatePending", "UpdateFailed".
* Get the cost property: The monthly cost of the phone number.
*
* @return the activationState value.
* @return the cost value.
*/
public ActivationState getActivationState() {
return this.activationState;
public PhoneNumberCost getCost() {
return this.cost;
}

/**
* Set the activationState property: The activation state of the phone number. Can be "Activated",
* "AssignmentPending", "AssignmentFailed", "UpdatePending", "UpdateFailed".
* Set the cost property: The monthly cost of the phone number.
*
* @param activationState the activationState value to set.
* @param cost the cost value to set.
* @return the AcquiredPhoneNumber object itself.
*/
public AcquiredPhoneNumber setActivationState(ActivationState activationState) {
this.activationState = activationState;
public AcquiredPhoneNumber setCost(PhoneNumberCost cost) {
this.cost = cost;
return this;
}
}
Loading