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

deprecate-baseurl-in-favor-of-endpoint #2246

Merged
merged 23 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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 @@ -12,7 +12,8 @@ import { BodyComplexRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): BodyComplexRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-body-complex-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as BodyComplexRestClient;
const client = getClient(endpointUrl, options) as BodyComplexRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { BodyFileClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): BodyFileClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-body-file-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as BodyFileClient;
const client = getClient(endpointUrl, options) as BodyFileClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { BodyFormDataClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): BodyFormDataClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-body-formdata-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as BodyFormDataClient;
const client = getClient(endpointUrl, options) as BodyFormDataClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { BodyStringRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): BodyStringRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-body-string-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as BodyStringRestClient;
const client = getClient(endpointUrl, options) as BodyStringRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export default function createClient(
host: string,
options: ClientOptions = {},
): CustomUrlRestClient {
const baseUrl = options.baseUrl ?? `http://{accountName}${host}`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://{accountName}${host}`;
const userAgentInfo = `azsdk-js-custom-url-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -30,7 +31,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as CustomUrlRestClient;
const client = getClient(endpointUrl, options) as CustomUrlRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { DPGCustomizationClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): DPGCustomizationClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-dpg-customization-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as DPGCustomizationClient;
const client = getClient(endpointUrl, options) as DPGCustomizationClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { HeaderRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): HeaderRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-header-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as HeaderRestClient;
const client = getClient(endpointUrl, options) as HeaderRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { HttpInfrastructureRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): HttpInfrastructureRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-http-infrastructure-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,10 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as HttpInfrastructureRestClient;
const client = getClient(
endpointUrl,
options,
) as HttpInfrastructureRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { LRORestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): LRORestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-lro-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as LRORestClient;
const client = getClient(endpointUrl, options) as LRORestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { MediaTypesClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): MediaTypesClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-media-types-service-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as MediaTypesClient;
const client = getClient(endpointUrl, options) as MediaTypesClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { MultipleInheritanceRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): MultipleInheritanceRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-multiple-inheritance-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,10 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as MultipleInheritanceRestClient;
const client = getClient(
endpointUrl,
options,
) as MultipleInheritanceRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export default function createClient(
credentials: TokenCredential,
options: ClientOptions = {},
): MultipleUrlParameterRestClient {
const baseUrl =
const endpointUrl =
options.endpoint ??
options.baseUrl ??
`${endpoint}/catalog/api/atlas/${serviceVersion}/{accountName}`;

Expand All @@ -42,7 +43,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as MultipleUrlParameterRestClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { PagingClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): PagingClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-paging-service-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as PagingClient;
const client = getClient(endpointUrl, options) as PagingClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function createClient(
credentials: TokenCredential,
options: ClientOptions = {},
): SecurityAADRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-security-aad-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -37,7 +38,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as SecurityAADRestClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function createClient(
credentials: KeyCredential,
options: ClientOptions = {},
): SecurityKeyRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-security-key-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -35,7 +36,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as SecurityKeyRestClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import { UrlRestClient } from "./clientDefinitions";
export default function createClient(
options: ClientOptions = {},
): UrlRestClient {
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
const endpointUrl =
options.endpoint ?? options.baseUrl ?? `http://localhost:3000`;
const userAgentInfo = `azsdk-js-url-rest/1.0.0-preview1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
Expand All @@ -28,7 +29,7 @@ export default function createClient(
},
};

const client = getClient(baseUrl, options) as UrlRestClient;
const client = getClient(endpointUrl, options) as UrlRestClient;

client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function createClient(
credentials: KeyCredential,
options: ClientOptions = {},
): AzureAgriFoodPlatformDataPlaneServiceClient {
const baseUrl = options.baseUrl ?? `${endpoint}`;
const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpoint}`;

const userAgentInfo = `azsdk-js-agrifood-data-plane-rest/1.0.0-beta.1`;
const userAgentPrefix =
Expand All @@ -39,7 +39,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as AzureAgriFoodPlatformDataPlaneServiceClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export default function createClient(
options: AnomalyDetectorMVClientOptions = {},
): AnomalyDetectorMVClient {
const apiVersion = options.apiVersion ?? "v1.1";
const baseUrl =
options.baseUrl ?? `${endpoint}/anomalydetector/${apiVersion}`;
const endpointUrl =
options.endpoint ??
options.baseUrl ??
`${endpoint}/anomalydetector/${apiVersion}`;

const userAgentInfo = `azsdk-js-anomaly-detector-mv-rest/1.0.0-beta.1`;
const userAgentPrefix =
Expand All @@ -45,7 +47,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as AnomalyDetectorMVClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ export default function createClient(
credentials: KeyCredential,
options: ClientOptions = {},
): AnomalyDetectorRestClient {
const baseUrl =
options.baseUrl ?? `${endpoint}/anomalydetector/${apiVersion}`;
const endpointUrl =
options.endpoint ??
options.baseUrl ??
`${endpoint}/anomalydetector/${apiVersion}`;

const userAgentInfo = `azsdk-js-anomaly-detector-rest/1.0.0-beta.1`;
const userAgentPrefix =
Expand All @@ -42,7 +44,7 @@ export default function createClient(
};

const client = getClient(
baseUrl,
endpointUrl,
credentials,
options,
) as AnomalyDetectorRestClient;
Expand Down
Loading
Loading