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

[v6] Use host default value #676

Merged
merged 2 commits into from
Jun 25, 2020
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 src/transforms/urlTransforms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export async function transformBaseUrl(
let isCustom = false;

const $host = (codeModel.globalParameters || []).find(p => {
const { serializedName } = getLanguageMetadata(p.language);
serializedName === "$host";
const { name } = getLanguageMetadata(p.language);
return name === "$host" && Boolean(p.clientDefaultValue);
});

if (!$host) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class AdditionalPropertiesClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class AzureParameterGroupingClientContext extends coreHttp.ServiceClient

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ReportClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class AzureSpecialPropertiesClientContext extends coreHttp.ServiceClient

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyArrayClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyBooleanClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyBooleanQuirksClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyByteClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class BodyComplexClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyDateClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyDateTimeClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyDateTimeRfc1123ClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyDictionaryClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyDurationClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyFileClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyIntegerClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyNumberClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyStringClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class BodyTimeClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class HeaderClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class HttpInfrastructureClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
2 changes: 1 addition & 1 deletion test/integration/generated/lro/src/lROClientContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class LROClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class MediaTypesClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ModelFlatteningClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class MultipleInheritanceClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class PagingClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class ReportClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
2 changes: 1 addition & 1 deletion test/integration/generated/url/src/urlClientContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class UrlClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Parameter assignments
this.globalStringPath = globalStringPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class XmlServiceClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "http://localhost:3000";

// Assigning values to Constant parameters
this.$host = options.$host || "http://localhost:3000";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ADHybridHealthServiceContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class DeploymentScriptsClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class FeatureClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ManagementLinkClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ManagementLockClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ApplicationClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class PolicyClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ResourceManagementClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class SubscriptionClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ComputeManagementClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class CosmosDBManagementClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class GraphRbacManagementClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://graph.windows.net";

// Parameter assignments
this.tenantID = tenantID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class KeyVaultManagementClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://management.azure.com";

// Parameter assignments
this.subscriptionId = subscriptionId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class MonitorClientContext extends coreHttp.ServiceClient {

this.requestContentType = "application/json; charset=utf-8";

this.baseUri = options.endpoint || "{$host}";
this.baseUri = options.endpoint || "https://monitoring.azure.com";

// Assigning values to Constant parameters
this.$host = options.$host || "https://monitoring.azure.com";
Expand Down
Loading