diff --git a/profiles/latest/cognitiveservices/face/models.go b/profiles/latest/cognitiveservices/face/models.go index b4ab5ad79a38..5546f0223432 100644 --- a/profiles/latest/cognitiveservices/face/models.go +++ b/profiles/latest/cognitiveservices/face/models.go @@ -51,27 +51,6 @@ const ( AttributeTypeSmile AttributeType = original.AttributeTypeSmile ) -type AzureRegions = original.AzureRegions - -const ( - Australiaeast AzureRegions = original.Australiaeast - Brazilsouth AzureRegions = original.Brazilsouth - Canadacentral AzureRegions = original.Canadacentral - Centralindia AzureRegions = original.Centralindia - Eastasia AzureRegions = original.Eastasia - Eastus AzureRegions = original.Eastus - Eastus2 AzureRegions = original.Eastus2 - Japaneast AzureRegions = original.Japaneast - Northeurope AzureRegions = original.Northeurope - Southcentralus AzureRegions = original.Southcentralus - Southeastasia AzureRegions = original.Southeastasia - Uksouth AzureRegions = original.Uksouth - Westcentralus AzureRegions = original.Westcentralus - Westeurope AzureRegions = original.Westeurope - Westus AzureRegions = original.Westus - Westus2 AzureRegions = original.Westus2 -) - type BlurLevel = original.BlurLevel const ( @@ -187,17 +166,17 @@ type VerifyResult = original.VerifyResult type PersonGroupClient = original.PersonGroupClient type PersonGroupPersonClient = original.PersonGroupPersonClient -func New(azureRegion AzureRegions) BaseClient { - return original.New(azureRegion) +func New(endpoint string) BaseClient { + return original.New(endpoint) } -func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { - return original.NewWithoutDefaults(azureRegion) +func NewWithoutDefaults(endpoint string) BaseClient { + return original.NewWithoutDefaults(endpoint) } -func NewClient(azureRegion AzureRegions) Client { - return original.NewClient(azureRegion) +func NewClient(endpoint string) Client { + return original.NewClient(endpoint) } -func NewListClient(azureRegion AzureRegions) ListClient { - return original.NewListClient(azureRegion) +func NewListClient(endpoint string) ListClient { + return original.NewListClient(endpoint) } func PossibleAccessoryTypeValues() []AccessoryType { return original.PossibleAccessoryTypeValues() @@ -205,9 +184,6 @@ func PossibleAccessoryTypeValues() []AccessoryType { func PossibleAttributeTypeValues() []AttributeType { return original.PossibleAttributeTypeValues() } -func PossibleAzureRegionsValues() []AzureRegions { - return original.PossibleAzureRegionsValues() -} func PossibleBlurLevelValues() []BlurLevel { return original.PossibleBlurLevelValues() } @@ -232,11 +208,11 @@ func PossibleNoiseLevelValues() []NoiseLevel { func PossibleTrainingStatusTypeValues() []TrainingStatusType { return original.PossibleTrainingStatusTypeValues() } -func NewPersonGroupClient(azureRegion AzureRegions) PersonGroupClient { - return original.NewPersonGroupClient(azureRegion) +func NewPersonGroupClient(endpoint string) PersonGroupClient { + return original.NewPersonGroupClient(endpoint) } -func NewPersonGroupPersonClient(azureRegion AzureRegions) PersonGroupPersonClient { - return original.NewPersonGroupPersonClient(azureRegion) +func NewPersonGroupPersonClient(endpoint string) PersonGroupPersonClient { + return original.NewPersonGroupPersonClient(endpoint) } func UserAgent() string { return original.UserAgent() + " profiles/latest" diff --git a/profiles/preview/cognitiveservices/face/models.go b/profiles/preview/cognitiveservices/face/models.go index 2ad602e5969a..879aa5bd927f 100644 --- a/profiles/preview/cognitiveservices/face/models.go +++ b/profiles/preview/cognitiveservices/face/models.go @@ -51,27 +51,6 @@ const ( AttributeTypeSmile AttributeType = original.AttributeTypeSmile ) -type AzureRegions = original.AzureRegions - -const ( - Australiaeast AzureRegions = original.Australiaeast - Brazilsouth AzureRegions = original.Brazilsouth - Canadacentral AzureRegions = original.Canadacentral - Centralindia AzureRegions = original.Centralindia - Eastasia AzureRegions = original.Eastasia - Eastus AzureRegions = original.Eastus - Eastus2 AzureRegions = original.Eastus2 - Japaneast AzureRegions = original.Japaneast - Northeurope AzureRegions = original.Northeurope - Southcentralus AzureRegions = original.Southcentralus - Southeastasia AzureRegions = original.Southeastasia - Uksouth AzureRegions = original.Uksouth - Westcentralus AzureRegions = original.Westcentralus - Westeurope AzureRegions = original.Westeurope - Westus AzureRegions = original.Westus - Westus2 AzureRegions = original.Westus2 -) - type BlurLevel = original.BlurLevel const ( @@ -187,17 +166,17 @@ type VerifyResult = original.VerifyResult type PersonGroupClient = original.PersonGroupClient type PersonGroupPersonClient = original.PersonGroupPersonClient -func New(azureRegion AzureRegions) BaseClient { - return original.New(azureRegion) +func New(endpoint string) BaseClient { + return original.New(endpoint) } -func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { - return original.NewWithoutDefaults(azureRegion) +func NewWithoutDefaults(endpoint string) BaseClient { + return original.NewWithoutDefaults(endpoint) } -func NewClient(azureRegion AzureRegions) Client { - return original.NewClient(azureRegion) +func NewClient(endpoint string) Client { + return original.NewClient(endpoint) } -func NewListClient(azureRegion AzureRegions) ListClient { - return original.NewListClient(azureRegion) +func NewListClient(endpoint string) ListClient { + return original.NewListClient(endpoint) } func PossibleAccessoryTypeValues() []AccessoryType { return original.PossibleAccessoryTypeValues() @@ -205,9 +184,6 @@ func PossibleAccessoryTypeValues() []AccessoryType { func PossibleAttributeTypeValues() []AttributeType { return original.PossibleAttributeTypeValues() } -func PossibleAzureRegionsValues() []AzureRegions { - return original.PossibleAzureRegionsValues() -} func PossibleBlurLevelValues() []BlurLevel { return original.PossibleBlurLevelValues() } @@ -232,11 +208,11 @@ func PossibleNoiseLevelValues() []NoiseLevel { func PossibleTrainingStatusTypeValues() []TrainingStatusType { return original.PossibleTrainingStatusTypeValues() } -func NewPersonGroupClient(azureRegion AzureRegions) PersonGroupClient { - return original.NewPersonGroupClient(azureRegion) +func NewPersonGroupClient(endpoint string) PersonGroupClient { + return original.NewPersonGroupClient(endpoint) } -func NewPersonGroupPersonClient(azureRegion AzureRegions) PersonGroupPersonClient { - return original.NewPersonGroupPersonClient(azureRegion) +func NewPersonGroupPersonClient(endpoint string) PersonGroupPersonClient { + return original.NewPersonGroupPersonClient(endpoint) } func UserAgent() string { return original.UserAgent() + " profiles/preview" diff --git a/services/cognitiveservices/v1.0/face/client.go b/services/cognitiveservices/v1.0/face/client.go index 411dfef3a82e..6789f2838614 100644 --- a/services/cognitiveservices/v1.0/face/client.go +++ b/services/cognitiveservices/v1.0/face/client.go @@ -27,18 +27,18 @@ import ( // BaseClient is the base client for Face. type BaseClient struct { autorest.Client - AzureRegion AzureRegions + Endpoint string } // New creates an instance of the BaseClient client. -func New(azureRegion AzureRegions) BaseClient { - return NewWithoutDefaults(azureRegion) +func New(endpoint string) BaseClient { + return NewWithoutDefaults(endpoint) } // NewWithoutDefaults creates an instance of the BaseClient client. -func NewWithoutDefaults(azureRegion AzureRegions) BaseClient { +func NewWithoutDefaults(endpoint string) BaseClient { return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - AzureRegion: azureRegion, + Client: autorest.NewClientWithUserAgent(UserAgent()), + Endpoint: endpoint, } } diff --git a/services/cognitiveservices/v1.0/face/face.go b/services/cognitiveservices/v1.0/face/face.go index eab2a3c1cd9e..0315dcb3e9b1 100644 --- a/services/cognitiveservices/v1.0/face/face.go +++ b/services/cognitiveservices/v1.0/face/face.go @@ -32,8 +32,8 @@ type Client struct { } // NewClient creates an instance of the Client client. -func NewClient(azureRegion AzureRegions) Client { - return Client{New(azureRegion)} +func NewClient(endpoint string) Client { + return Client{New(endpoint)} } // DetectWithStream detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, @@ -72,7 +72,7 @@ func (client Client) DetectWithStream(ctx context.Context, imageParameter io.Rea // DetectWithStreamPreparer prepares the DetectWithStream request. func (client Client) DetectWithStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeType) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } queryParameters := map[string]interface{}{} @@ -93,7 +93,7 @@ func (client Client) DetectWithStreamPreparer(ctx context.Context, imageParamete preparer := autorest.CreatePreparer( autorest.AsContentType("application/octet-stream"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/detect"), autorest.WithFile(imageParameter), autorest.WithQueryParameters(queryParameters)) @@ -162,7 +162,7 @@ func (client Client) DetectWithURL(ctx context.Context, imageURL ImageURL, retur // DetectWithURLPreparer prepares the DetectWithURL request. func (client Client) DetectWithURLPreparer(ctx context.Context, imageURL ImageURL, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeType) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } queryParameters := map[string]interface{}{} @@ -183,7 +183,7 @@ func (client Client) DetectWithURLPreparer(ctx context.Context, imageURL ImageUR preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/detect"), autorest.WithJSON(imageURL), autorest.WithQueryParameters(queryParameters)) @@ -254,13 +254,13 @@ func (client Client) FindSimilar(ctx context.Context, body FindSimilarRequest) ( // FindSimilarPreparer prepares the FindSimilar request. func (client Client) FindSimilarPreparer(ctx context.Context, body FindSimilarRequest) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/findsimilars"), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -321,13 +321,13 @@ func (client Client) Group(ctx context.Context, body GroupRequest) (result Group // GroupPreparer prepares the Group request. func (client Client) GroupPreparer(ctx context.Context, body GroupRequest) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/group"), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -396,13 +396,13 @@ func (client Client) Identify(ctx context.Context, body IdentifyRequest) (result // IdentifyPreparer prepares the Identify request. func (client Client) IdentifyPreparer(ctx context.Context, body IdentifyRequest) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/identify"), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -463,13 +463,13 @@ func (client Client) VerifyFaceToFace(ctx context.Context, body VerifyFaceToFace // VerifyFaceToFacePreparer prepares the VerifyFaceToFace request. func (client Client) VerifyFaceToFacePreparer(ctx context.Context, body VerifyFaceToFaceRequest) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/verify"), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -534,13 +534,13 @@ func (client Client) VerifyFaceToPerson(ctx context.Context, body VerifyFaceToPe // VerifyFaceToPersonPreparer prepares the VerifyFaceToPerson request. func (client Client) VerifyFaceToPersonPreparer(ctx context.Context, body VerifyFaceToPersonRequest) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/verify"), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/cognitiveservices/v1.0/face/list.go b/services/cognitiveservices/v1.0/face/list.go index 31e426d31caa..27362c844411 100644 --- a/services/cognitiveservices/v1.0/face/list.go +++ b/services/cognitiveservices/v1.0/face/list.go @@ -33,8 +33,8 @@ type ListClient struct { } // NewListClient creates an instance of the ListClient client. -func NewListClient(azureRegion AzureRegions) ListClient { - return ListClient{New(azureRegion)} +func NewListClient(endpoint string) ListClient { + return ListClient{New(endpoint)} } // AddFaceFromStream add a face to a face list. The input face is specified as an image with a targetFace rectangle. It @@ -81,7 +81,7 @@ func (client ListClient) AddFaceFromStream(ctx context.Context, faceListID strin // AddFaceFromStreamPreparer prepares the AddFaceFromStream request. func (client ListClient) AddFaceFromStreamPreparer(ctx context.Context, faceListID string, imageParameter io.ReadCloser, userData string, targetFace []int32) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -99,7 +99,7 @@ func (client ListClient) AddFaceFromStreamPreparer(ctx context.Context, faceList preparer := autorest.CreatePreparer( autorest.AsContentType("application/octet-stream"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/facelists/{faceListId}/persistedFaces", pathParameters), autorest.WithFile(imageParameter), autorest.WithQueryParameters(queryParameters)) @@ -172,7 +172,7 @@ func (client ListClient) AddFaceFromURL(ctx context.Context, faceListID string, // AddFaceFromURLPreparer prepares the AddFaceFromURL request. func (client ListClient) AddFaceFromURLPreparer(ctx context.Context, faceListID string, imageURL ImageURL, userData string, targetFace []int32) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -190,7 +190,7 @@ func (client ListClient) AddFaceFromURLPreparer(ctx context.Context, faceListID preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/facelists/{faceListId}/persistedFaces", pathParameters), autorest.WithJSON(imageURL), autorest.WithQueryParameters(queryParameters)) @@ -258,7 +258,7 @@ func (client ListClient) Create(ctx context.Context, faceListID string, body Nam // CreatePreparer prepares the Create request. func (client ListClient) CreatePreparer(ctx context.Context, faceListID string, body NameAndUserDataContract) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -268,7 +268,7 @@ func (client ListClient) CreatePreparer(ctx context.Context, faceListID string, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/facelists/{faceListId}", pathParameters), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -329,7 +329,7 @@ func (client ListClient) Delete(ctx context.Context, faceListID string) (result // DeletePreparer prepares the Delete request. func (client ListClient) DeletePreparer(ctx context.Context, faceListID string) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -338,7 +338,7 @@ func (client ListClient) DeletePreparer(ctx context.Context, faceListID string) preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/facelists/{faceListId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -399,7 +399,7 @@ func (client ListClient) DeleteFace(ctx context.Context, faceListID string, pers // DeleteFacePreparer prepares the DeleteFace request. func (client ListClient) DeleteFacePreparer(ctx context.Context, faceListID string, persistedFaceID uuid.UUID) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -409,7 +409,7 @@ func (client ListClient) DeleteFacePreparer(ctx context.Context, faceListID stri preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/facelists/{faceListId}/persistedFaces/{persistedFaceId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -468,7 +468,7 @@ func (client ListClient) Get(ctx context.Context, faceListID string) (result Lis // GetPreparer prepares the Get request. func (client ListClient) GetPreparer(ctx context.Context, faceListID string) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -477,7 +477,7 @@ func (client ListClient) GetPreparer(ctx context.Context, faceListID string) (*h preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/facelists/{faceListId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -528,12 +528,12 @@ func (client ListClient) List(ctx context.Context) (result ListList, err error) // ListPreparer prepares the List request. func (client ListClient) ListPreparer(ctx context.Context) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/facelists")) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -594,7 +594,7 @@ func (client ListClient) Update(ctx context.Context, faceListID string, body Nam // UpdatePreparer prepares the Update request. func (client ListClient) UpdatePreparer(ctx context.Context, faceListID string, body NameAndUserDataContract) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -604,7 +604,7 @@ func (client ListClient) UpdatePreparer(ctx context.Context, faceListID string, preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/facelists/{faceListId}", pathParameters), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/cognitiveservices/v1.0/face/models.go b/services/cognitiveservices/v1.0/face/models.go index 40080462989b..eb817d3afd09 100644 --- a/services/cognitiveservices/v1.0/face/models.go +++ b/services/cognitiveservices/v1.0/face/models.go @@ -79,49 +79,6 @@ func PossibleAttributeTypeValues() []AttributeType { return []AttributeType{AttributeTypeAccessories, AttributeTypeAge, AttributeTypeBlur, AttributeTypeEmotion, AttributeTypeExposure, AttributeTypeFacialHair, AttributeTypeGender, AttributeTypeGlasses, AttributeTypeHair, AttributeTypeHeadPose, AttributeTypeMakeup, AttributeTypeNoise, AttributeTypeOcclusion, AttributeTypeSmile} } -// AzureRegions enumerates the values for azure regions. -type AzureRegions string - -const ( - // Australiaeast ... - Australiaeast AzureRegions = "australiaeast" - // Brazilsouth ... - Brazilsouth AzureRegions = "brazilsouth" - // Canadacentral ... - Canadacentral AzureRegions = "canadacentral" - // Centralindia ... - Centralindia AzureRegions = "centralindia" - // Eastasia ... - Eastasia AzureRegions = "eastasia" - // Eastus ... - Eastus AzureRegions = "eastus" - // Eastus2 ... - Eastus2 AzureRegions = "eastus2" - // Japaneast ... - Japaneast AzureRegions = "japaneast" - // Northeurope ... - Northeurope AzureRegions = "northeurope" - // Southcentralus ... - Southcentralus AzureRegions = "southcentralus" - // Southeastasia ... - Southeastasia AzureRegions = "southeastasia" - // Uksouth ... - Uksouth AzureRegions = "uksouth" - // Westcentralus ... - Westcentralus AzureRegions = "westcentralus" - // Westeurope ... - Westeurope AzureRegions = "westeurope" - // Westus ... - Westus AzureRegions = "westus" - // Westus2 ... - Westus2 AzureRegions = "westus2" -) - -// PossibleAzureRegionsValues returns an array of possible values for the AzureRegions const type. -func PossibleAzureRegionsValues() []AzureRegions { - return []AzureRegions{Australiaeast, Brazilsouth, Canadacentral, Centralindia, Eastasia, Eastus, Eastus2, Japaneast, Northeurope, Southcentralus, Southeastasia, Uksouth, Westcentralus, Westeurope, Westus, Westus2} -} - // BlurLevel enumerates the values for blur level. type BlurLevel string diff --git a/services/cognitiveservices/v1.0/face/persongroup.go b/services/cognitiveservices/v1.0/face/persongroup.go index a1b5801dd7bc..187995bd22d1 100644 --- a/services/cognitiveservices/v1.0/face/persongroup.go +++ b/services/cognitiveservices/v1.0/face/persongroup.go @@ -31,8 +31,8 @@ type PersonGroupClient struct { } // NewPersonGroupClient creates an instance of the PersonGroupClient client. -func NewPersonGroupClient(azureRegion AzureRegions) PersonGroupClient { - return PersonGroupClient{New(azureRegion)} +func NewPersonGroupClient(endpoint string) PersonGroupClient { + return PersonGroupClient{New(endpoint)} } // Create create a new person group with specified personGroupId, name and user-provided userData. @@ -76,7 +76,7 @@ func (client PersonGroupClient) Create(ctx context.Context, personGroupID string // CreatePreparer prepares the Create request. func (client PersonGroupClient) CreatePreparer(ctx context.Context, personGroupID string, body NameAndUserDataContract) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -86,7 +86,7 @@ func (client PersonGroupClient) CreatePreparer(ctx context.Context, personGroupI preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}", pathParameters), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -147,7 +147,7 @@ func (client PersonGroupClient) Delete(ctx context.Context, personGroupID string // DeletePreparer prepares the Delete request. func (client PersonGroupClient) DeletePreparer(ctx context.Context, personGroupID string) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -156,7 +156,7 @@ func (client PersonGroupClient) DeletePreparer(ctx context.Context, personGroupI preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -215,7 +215,7 @@ func (client PersonGroupClient) Get(ctx context.Context, personGroupID string) ( // GetPreparer prepares the Get request. func (client PersonGroupClient) GetPreparer(ctx context.Context, personGroupID string) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -224,7 +224,7 @@ func (client PersonGroupClient) GetPreparer(ctx context.Context, personGroupID s preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -284,7 +284,7 @@ func (client PersonGroupClient) GetTrainingStatus(ctx context.Context, personGro // GetTrainingStatusPreparer prepares the GetTrainingStatus request. func (client PersonGroupClient) GetTrainingStatusPreparer(ctx context.Context, personGroupID string) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -293,7 +293,7 @@ func (client PersonGroupClient) GetTrainingStatusPreparer(ctx context.Context, p preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/training", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -358,7 +358,7 @@ func (client PersonGroupClient) List(ctx context.Context, start string, top *int // ListPreparer prepares the List request. func (client PersonGroupClient) ListPreparer(ctx context.Context, start string, top *int32) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } queryParameters := map[string]interface{}{} @@ -373,7 +373,7 @@ func (client PersonGroupClient) ListPreparer(ctx context.Context, start string, preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPath("/persongroups"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -434,7 +434,7 @@ func (client PersonGroupClient) Train(ctx context.Context, personGroupID string) // TrainPreparer prepares the Train request. func (client PersonGroupClient) TrainPreparer(ctx context.Context, personGroupID string) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -443,7 +443,7 @@ func (client PersonGroupClient) TrainPreparer(ctx context.Context, personGroupID preparer := autorest.CreatePreparer( autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/train", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -504,7 +504,7 @@ func (client PersonGroupClient) Update(ctx context.Context, personGroupID string // UpdatePreparer prepares the Update request. func (client PersonGroupClient) UpdatePreparer(ctx context.Context, personGroupID string, body NameAndUserDataContract) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -514,7 +514,7 @@ func (client PersonGroupClient) UpdatePreparer(ctx context.Context, personGroupI preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}", pathParameters), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/cognitiveservices/v1.0/face/persongroupperson.go b/services/cognitiveservices/v1.0/face/persongroupperson.go index 228dfb6e0b66..9f4e6430a33c 100644 --- a/services/cognitiveservices/v1.0/face/persongroupperson.go +++ b/services/cognitiveservices/v1.0/face/persongroupperson.go @@ -33,8 +33,8 @@ type PersonGroupPersonClient struct { } // NewPersonGroupPersonClient creates an instance of the PersonGroupPersonClient client. -func NewPersonGroupPersonClient(azureRegion AzureRegions) PersonGroupPersonClient { - return PersonGroupPersonClient{New(azureRegion)} +func NewPersonGroupPersonClient(endpoint string) PersonGroupPersonClient { + return PersonGroupPersonClient{New(endpoint)} } // AddPersonFaceFromStream add a representative face to a person for identification. The input face is specified as an @@ -82,7 +82,7 @@ func (client PersonGroupPersonClient) AddPersonFaceFromStream(ctx context.Contex // AddPersonFaceFromStreamPreparer prepares the AddPersonFaceFromStream request. func (client PersonGroupPersonClient) AddPersonFaceFromStreamPreparer(ctx context.Context, personGroupID string, personID uuid.UUID, imageParameter io.ReadCloser, userData string, targetFace []int32) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -101,7 +101,7 @@ func (client PersonGroupPersonClient) AddPersonFaceFromStreamPreparer(ctx contex preparer := autorest.CreatePreparer( autorest.AsContentType("application/octet-stream"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons/{personId}/persistedFaces", pathParameters), autorest.WithFile(imageParameter), autorest.WithQueryParameters(queryParameters)) @@ -175,7 +175,7 @@ func (client PersonGroupPersonClient) AddPersonFaceFromURL(ctx context.Context, // AddPersonFaceFromURLPreparer prepares the AddPersonFaceFromURL request. func (client PersonGroupPersonClient) AddPersonFaceFromURLPreparer(ctx context.Context, personGroupID string, personID uuid.UUID, imageURL ImageURL, userData string, targetFace []int32) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -194,7 +194,7 @@ func (client PersonGroupPersonClient) AddPersonFaceFromURLPreparer(ctx context.C preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons/{personId}/persistedFaces", pathParameters), autorest.WithJSON(imageURL), autorest.WithQueryParameters(queryParameters)) @@ -262,7 +262,7 @@ func (client PersonGroupPersonClient) Create(ctx context.Context, personGroupID // CreatePreparer prepares the Create request. func (client PersonGroupPersonClient) CreatePreparer(ctx context.Context, personGroupID string, body NameAndUserDataContract) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -272,7 +272,7 @@ func (client PersonGroupPersonClient) CreatePreparer(ctx context.Context, person preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons", pathParameters), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -334,7 +334,7 @@ func (client PersonGroupPersonClient) Delete(ctx context.Context, personGroupID // DeletePreparer prepares the Delete request. func (client PersonGroupPersonClient) DeletePreparer(ctx context.Context, personGroupID string, personID uuid.UUID) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -344,7 +344,7 @@ func (client PersonGroupPersonClient) DeletePreparer(ctx context.Context, person preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons/{personId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -405,7 +405,7 @@ func (client PersonGroupPersonClient) DeleteFace(ctx context.Context, personGrou // DeleteFacePreparer prepares the DeleteFace request. func (client PersonGroupPersonClient) DeleteFacePreparer(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -416,7 +416,7 @@ func (client PersonGroupPersonClient) DeleteFacePreparer(ctx context.Context, pe preparer := autorest.CreatePreparer( autorest.AsDelete(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons/{personId}/persistedFaces/{persistedFaceId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -476,7 +476,7 @@ func (client PersonGroupPersonClient) Get(ctx context.Context, personGroupID str // GetPreparer prepares the Get request. func (client PersonGroupPersonClient) GetPreparer(ctx context.Context, personGroupID string, personID uuid.UUID) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -486,7 +486,7 @@ func (client PersonGroupPersonClient) GetPreparer(ctx context.Context, personGro preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons/{personId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -549,7 +549,7 @@ func (client PersonGroupPersonClient) GetFace(ctx context.Context, personGroupID // GetFacePreparer prepares the GetFace request. func (client PersonGroupPersonClient) GetFacePreparer(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -560,7 +560,7 @@ func (client PersonGroupPersonClient) GetFacePreparer(ctx context.Context, perso preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons/{personId}/persistedFaces/{persistedFaceId}", pathParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -628,7 +628,7 @@ func (client PersonGroupPersonClient) List(ctx context.Context, personGroupID st // ListPreparer prepares the List request. func (client PersonGroupPersonClient) ListPreparer(ctx context.Context, personGroupID string, start string, top *int32) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -645,7 +645,7 @@ func (client PersonGroupPersonClient) ListPreparer(ctx context.Context, personGr preparer := autorest.CreatePreparer( autorest.AsGet(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -708,7 +708,7 @@ func (client PersonGroupPersonClient) Update(ctx context.Context, personGroupID // UpdatePreparer prepares the Update request. func (client PersonGroupPersonClient) UpdatePreparer(ctx context.Context, personGroupID string, personID uuid.UUID, body NameAndUserDataContract) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -719,7 +719,7 @@ func (client PersonGroupPersonClient) UpdatePreparer(ctx context.Context, person preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons/{personId}", pathParameters), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -782,7 +782,7 @@ func (client PersonGroupPersonClient) UpdateFace(ctx context.Context, personGrou // UpdateFacePreparer prepares the UpdateFace request. func (client PersonGroupPersonClient) UpdateFacePreparer(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID, body UpdatePersonFaceRequest) (*http.Request, error) { urlParameters := map[string]interface{}{ - "AzureRegion": client.AzureRegion, + "Endpoint": client.Endpoint, } pathParameters := map[string]interface{}{ @@ -794,7 +794,7 @@ func (client PersonGroupPersonClient) UpdateFacePreparer(ctx context.Context, pe preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), - autorest.WithCustomBaseURL("https://{AzureRegion}.api.cognitive.microsoft.com/face/v1.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/face/v1.0", urlParameters), autorest.WithPathParameters("/persongroups/{personGroupId}/persons/{personId}/persistedFaces/{persistedFaceId}", pathParameters), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx))