{"action":"opened","issue":{"url":"https://api.github.com/repos/Azure/autorest/issues/2962","repository_url":"https://api.github.com/repos/Azure/autorest","labels_url":"https://api.github.com/repos/Azure/autorest/issues/2962/labels{/name}","comments_url":"https://api.github.com/repos/Azure/autorest/issues/2962/comments","events_url":"https://api.github.com/repos/Azure/autorest/issues/2962/events","html_url":"https://github.com/Azure/autorest/issues/2962","id":341251633,"node_id":"MDU6SXNzdWUzNDEyNTE2MzM=","number":2962,"title":"Allow to add mandatory parameters for Client constructors","user":{"login":"yangyuan","id":6030719,"node_id":"MDQ6VXNlcjYwMzA3MTk=","avatar_url":"https://avatars3.githubusercontent.com/u/6030719?v=4","gravatar_id":"","url":"https://api.github.com/users/yangyuan","html_url":"https://github.com/yangyuan","followers_url":"https://api.github.com/users/yangyuan/followers","following_url":"https://api.github.com/users/yangyuan/following{/other_user}","gists_url":"https://api.github.com/users/yangyuan/gists{/gist_id}","starred_url":"https://api.github.com/users/yangyuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yangyuan/subscriptions","organizations_url":"https://api.github.com/users/yangyuan/orgs","repos_url":"https://api.github.com/users/yangyuan/repos","events_url":"https://api.github.com/users/yangyuan/events{/privacy}","received_events_url":"https://api.github.com/users/yangyuan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-14T17:17:00Z","updated_at":"2018-07-14T17:17:00Z","closed_at":null,"author_association":"MEMBER","body":"Background: Cognitive Services have multiple possible endpoints, basically it's like ```http[s]://{anydomain}[:{anyport}]/{anybasepath}```\r\n\r\nRight now, we are using host and a placeholder uri:\r\n```host: https://placeholder.com/root```\r\nWe can also use this:\r\n```x-ms-parameterized-host: {Endpoint}```\r\n\r\nBut the problem is, for both, the C# Client constructors will make `BaseUri` or `Endpoint` optional.\r\nFor example, users can do both:\r\n```\r\nvar client = new XxxClient();\r\nclient.Endpoint = new Uri(\"http://10.0.0.4:5000/\");\r\n```\r\n```\r\nvar client = new XxxClient(new Uri(\"http://10.0.0.4:5000/\"));\r\n```\r\nWe want expose the constructors which contain mandatory parameter, so that Client user won't mistakenly forgot to change the default placeholder.\r\n\r\nMaybe we can support a new `x-ms-parameter-location`, so the parameter will be in constructor\r\n\"x-ms-parameter-location\": \"client-constructor\",\r\n\r\n"}}
{"actor":{"display_login":"yangyuan"}}