Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[communication] regenerate client from latest swagger #13976

Merged
merged 4 commits into from
Feb 26, 2021
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
4 changes: 2 additions & 2 deletions sdk/communication/communication-phone-numbers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
const client = new PhoneNumbersClient(connectionString);

async function main() {
const countryCode = "US";
const searchRequest = {
countryCode: "US",
phoneNumberType: "tollFree",
assignmentType: "application",
capabilities: {
Expand Down Expand Up @@ -145,8 +145,8 @@ const connectionString = "endpoint=<endpoint>;accessKey=<accessKey>";
const client = new PhoneNumbersClient(connectionString);

async function main() {
const countryCode = "US";
const searchRequest = {
countryCode: "US",
phoneNumberType: "tollFree",
assignmentType: "application",
capabilities: {
Expand Down
5 changes: 5 additions & 0 deletions sdk/communication/communication-phone-numbers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@
"sideEffects": false,
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
"dependencies": {
"@azure/communication-common": "1.0.0-beta.6",
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.2.0",
"@azure/core-http": "^1.2.0",
"@azure/core-lro": "^1.0.2",
"@azure/core-paging": "^1.1.1",
"@azure/core-tracing": "1.0.0-beta.1",
"@azure/logger": "^1.0.0",
"@opentelemetry/api": "^0.10.2",
"events": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import { TokenCredential } from '@azure/core-auth';
export interface AcquiredPhoneNumber {
assignmentType: PhoneNumberAssignmentType;
capabilities: PhoneNumberCapabilities;
cost?: PhoneNumberCost;
cost: PhoneNumberCost;
countryCode: string;
id: string;
phoneNumber: string;
phoneNumberType: PhoneNumberType;
purchaseDate?: Date;
purchaseDate: Date;
}

// @public (undocumented)
Expand All @@ -41,10 +41,10 @@ export interface BeginSearchAvailablePhoneNumbersOptions extends PhoneNumberPoll
export interface BeginUpdatePhoneNumberOptions extends PhoneNumberPollerOptionsBase, OperationOptions {
}

// @public (undocumented)
// @public
export type GetPhoneNumberOptions = OperationOptions;

// @public (undocumented)
// @public
export type GetPhoneNumberResponse = WithResponse<AcquiredPhoneNumber>;

// @public
Expand All @@ -58,18 +58,18 @@ export type PhoneNumberAssignmentType = "person" | "application";

// @public
export interface PhoneNumberCapabilities {
calling: PhoneNumberCapabilityValue;
sms: PhoneNumberCapabilityValue;
calling: PhoneNumberCapabilityType;
sms: PhoneNumberCapabilityType;
}

// @public
export interface PhoneNumberCapabilitiesRequest {
calling?: PhoneNumberCapabilityValue;
sms?: PhoneNumberCapabilityValue;
calling?: PhoneNumberCapabilityType;
sms?: PhoneNumberCapabilityType;
}

// @public
export type PhoneNumberCapabilityValue = "none" | "inbound" | "outbound" | "inbound+outbound";
export type PhoneNumberCapabilityType = "none" | "inbound" | "outbound" | "inbound+outbound";

// @public
export interface PhoneNumberCost {
Expand All @@ -93,7 +93,7 @@ export class PhoneNumbersClient {
constructor(url: string, credential: TokenCredential, options?: PhoneNumbersClientOptions);
beginPurchasePhoneNumbers(searchId: string, options?: BeginPurchasePhoneNumbersOptions): Promise<PollerLike<PollOperationState<VoidResponse>, VoidResponse>>;
beginReleasePhoneNumber(phoneNumber: string, options?: BeginReleasePhoneNumberOptions): Promise<PollerLike<PollOperationState<VoidResponse>, VoidResponse>>;
beginSearchAvailablePhoneNumbers(countryCode: string, search: PhoneNumberSearchRequest, options?: BeginSearchAvailablePhoneNumbersOptions): Promise<PollerLike<PollOperationState<PhoneNumberSearchResult>, PhoneNumberSearchResult>>;
beginSearchAvailablePhoneNumbers(search: SearchAvailablePhoneNumbersRequest, options?: BeginSearchAvailablePhoneNumbersOptions): Promise<PollerLike<PollOperationState<PhoneNumberSearchResult>, PhoneNumberSearchResult>>;
beginUpdatePhoneNumberCapabilities(phoneNumber: string, request: PhoneNumberCapabilitiesRequest, options?: BeginUpdatePhoneNumberOptions): Promise<PollerLike<PollOperationState<AcquiredPhoneNumber>, AcquiredPhoneNumber>>;
getPhoneNumber(phoneNumber: string, options?: GetPhoneNumberOptions): Promise<GetPhoneNumberResponse>;
listPhoneNumbers(options?: ListPhoneNumbersOptions): PagedAsyncIterableIterator<AcquiredPhoneNumber>;
Expand Down Expand Up @@ -126,6 +126,11 @@ export interface PhoneNumberSearchResult {
// @public
export type PhoneNumberType = "geographic" | "tollFree";

// @public
export interface SearchAvailablePhoneNumbersRequest extends PhoneNumberSearchRequest {
countryCode: string;
}

// @public
export type VoidResponse = WithResponse<{}>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export interface PhoneNumberSearchRequest {
/** Capabilities of a phone number. */
export interface PhoneNumberCapabilities {
/** Capability value for calling. */
calling: PhoneNumberCapabilityValue;
calling: PhoneNumberCapabilityType;
/** Capability value for SMS. */
sms: PhoneNumberCapabilityValue;
sms: PhoneNumberCapabilityType;
}

/** The result of a phone number search operation. */
Expand Down Expand Up @@ -130,9 +130,9 @@ export interface AcquiredPhoneNumber {
/** The assignment type of the phone number. A phone number can be assigned to a person, or to an application. */
assignmentType: PhoneNumberAssignmentType;
/** The date and time that the phone number was purchased. */
purchaseDate?: Date;
purchaseDate: Date;
/** The incurred cost for a single phone number. */
cost?: PhoneNumberCost;
cost: PhoneNumberCost;
}

/** The list of acquired phone numbers. */
Expand All @@ -146,9 +146,9 @@ export interface AcquiredPhoneNumbers {
/** Capabilities of a phone number. */
export interface PhoneNumberCapabilitiesRequest {
/** Capability value for calling. */
calling?: PhoneNumberCapabilityValue;
calling?: PhoneNumberCapabilityType;
/** Capability value for SMS. */
sms?: PhoneNumberCapabilityValue;
sms?: PhoneNumberCapabilityType;
}

/** Defines headers for PhoneNumbers_searchAvailablePhoneNumbers operation. */
Expand All @@ -165,8 +165,6 @@ export interface PhoneNumbersSearchAvailablePhoneNumbersHeaders {

/** Defines headers for PhoneNumbers_purchasePhoneNumbers operation. */
export interface PhoneNumbersPurchasePhoneNumbersHeaders {
/** URL to retrieve the final result after operation completes. */
location?: string;
/** URL to query for status of the operation. */
operationLocation?: string;
/** The operation id. */
Expand Down Expand Up @@ -207,8 +205,8 @@ export interface PhoneNumbersUpdateCapabilitiesHeaders {
export type PhoneNumberType = "geographic" | "tollFree";
/** Defines values for PhoneNumberAssignmentType. */
export type PhoneNumberAssignmentType = "person" | "application";
/** Defines values for PhoneNumberCapabilityValue. */
export type PhoneNumberCapabilityValue = "none" | "inbound" | "outbound" | "inbound+outbound";
/** Defines values for PhoneNumberCapabilityType. */
export type PhoneNumberCapabilityType = "none" | "inbound" | "outbound" | "inbound+outbound";
/** Defines values for PhoneNumberOperationStatus. */
export type PhoneNumberOperationStatus = "notStarted" | "running" | "succeeded" | "failed";
/** Defines values for PhoneNumberOperationType. */
Expand Down Expand Up @@ -263,21 +261,15 @@ export interface PhoneNumbersPurchasePhoneNumbersOptionalParams extends coreHttp
}

/** Contains response data for the purchasePhoneNumbers operation. */
export type PhoneNumbersPurchasePhoneNumbersResponse = PhoneNumbersPurchasePhoneNumbersHeaders &
PhoneNumberSearchResult & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The response body as text (string format) */
bodyAsText: string;

/** The response body as parsed JSON or XML */
parsedBody: PhoneNumberSearchResult;
/** The parsed HTTP response headers. */
parsedHeaders: PhoneNumbersPurchasePhoneNumbersHeaders;
/** The parsed HTTP response headers. */
[LROSYM]: LROResponseInfo;
};
export type PhoneNumbersPurchasePhoneNumbersResponse = PhoneNumbersPurchasePhoneNumbersHeaders & {
/** The underlying HTTP response. */
_response: coreHttp.HttpResponse & {
/** The parsed HTTP response headers. */
parsedHeaders: PhoneNumbersPurchasePhoneNumbersHeaders;
/** The parsed HTTP response headers. */
[LROSYM]: LROResponseInfo;
};
};

/** Contains response data for the getOperation operation. */
export type PhoneNumbersGetOperationResponse = PhoneNumbersGetOperationHeaders &
Expand Down Expand Up @@ -340,9 +332,9 @@ export type PhoneNumbersListPhoneNumbersResponse = AcquiredPhoneNumbers & {
/** Optional parameters. */
export interface PhoneNumbersUpdateCapabilitiesOptionalParams extends coreHttp.OperationOptions {
/** Capability value for calling. */
calling?: PhoneNumberCapabilityValue;
calling?: PhoneNumberCapabilityType;
/** Capability value for SMS. */
sms?: PhoneNumberCapabilityValue;
sms?: PhoneNumberCapabilityType;
}

/** Contains response data for the updateCapabilities operation. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ export const PhoneNumberSearchRequest: coreHttp.CompositeMapper = {
serializedName: "phoneNumberType",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["geographic", "tollFree"]
}
},
assignmentType: {
serializedName: "assignmentType",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["person", "application"]
}
},
capabilities: {
Expand Down Expand Up @@ -64,14 +66,16 @@ export const PhoneNumberCapabilities: coreHttp.CompositeMapper = {
serializedName: "calling",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["none", "inbound", "outbound", "inbound+outbound"]
}
},
sms: {
serializedName: "sms",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["none", "inbound", "outbound", "inbound+outbound"]
}
}
}
Expand Down Expand Up @@ -106,14 +110,16 @@ export const PhoneNumberSearchResult: coreHttp.CompositeMapper = {
serializedName: "phoneNumberType",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["geographic", "tollFree"]
}
},
assignmentType: {
serializedName: "assignmentType",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["person", "application"]
}
},
capabilities: {
Expand Down Expand Up @@ -262,7 +268,8 @@ export const PhoneNumberOperation: coreHttp.CompositeMapper = {
serializedName: "status",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["notStarted", "running", "succeeded", "failed"]
}
},
resourceLocation: {
Expand Down Expand Up @@ -296,7 +303,13 @@ export const PhoneNumberOperation: coreHttp.CompositeMapper = {
serializedName: "operationType",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: [
"purchase",
"releasePhoneNumber",
"search",
"updatePhoneNumberCapabilities"
]
}
},
lastActionDateTime: {
Expand Down Expand Up @@ -340,7 +353,8 @@ export const AcquiredPhoneNumber: coreHttp.CompositeMapper = {
serializedName: "phoneNumberType",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["geographic", "tollFree"]
}
},
capabilities: {
Expand All @@ -354,11 +368,13 @@ export const AcquiredPhoneNumber: coreHttp.CompositeMapper = {
serializedName: "assignmentType",
required: true,
type: {
name: "String"
name: "Enum",
allowedValues: ["person", "application"]
}
},
purchaseDate: {
serializedName: "purchaseDate",
required: true,
type: {
name: "DateTime"
}
Expand Down Expand Up @@ -410,13 +426,15 @@ export const PhoneNumberCapabilitiesRequest: coreHttp.CompositeMapper = {
calling: {
serializedName: "calling",
type: {
name: "String"
name: "Enum",
allowedValues: ["none", "inbound", "outbound", "inbound+outbound"]
}
},
sms: {
serializedName: "sms",
type: {
name: "String"
name: "Enum",
allowedValues: ["none", "inbound", "outbound", "inbound+outbound"]
}
}
}
Expand Down Expand Up @@ -461,12 +479,6 @@ export const PhoneNumbersPurchasePhoneNumbersHeaders: coreHttp.CompositeMapper =
name: "Composite",
className: "PhoneNumbersPurchasePhoneNumbersHeaders",
modelProperties: {
location: {
serializedName: "location",
type: {
name: "String"
}
},
operationLocation: {
serializedName: "operation-location",
type: {
Expand Down
Loading