From 9a377fcc0f1633ed7573bb418b548e8c8957d491 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot Date: Thu, 24 Oct 2019 13:13:55 +0800 Subject: [PATCH] Generated from 60f4598fd519843b5b992024169d9af2eab5bdbe (#6089) Changed WebActivity and webhook activity auth to support both AKV and Secrets --- .../mgmt/2018-06-01/datafactory/models.go | 62 ++++++++++++++++++- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go index ea7977a65b9f..7045cb572439 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/models.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -213504,15 +213504,73 @@ type WebActivityAuthentication struct { // Type - Web activity authentication (Basic/ClientCertificate/MSI) Type *string `json:"type,omitempty"` // Pfx - Base64-encoded contents of a PFX file. - Pfx *SecureString `json:"pfx,omitempty"` + Pfx BasicSecretBase `json:"pfx,omitempty"` // Username - Web activity authentication user name for basic authentication. Username *string `json:"username,omitempty"` // Password - Password for the PFX file or basic authentication. - Password *SecureString `json:"password,omitempty"` + Password BasicSecretBase `json:"password,omitempty"` // Resource - Resource for which Azure Auth token will be requested when using MSI Authentication. Resource *string `json:"resource,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for WebActivityAuthentication struct. +func (waa *WebActivityAuthentication) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + waa.Type = &typeVar + } + case "pfx": + if v != nil { + pfx, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + waa.Pfx = pfx + } + case "username": + if v != nil { + var username string + err = json.Unmarshal(*v, &username) + if err != nil { + return err + } + waa.Username = &username + } + case "password": + if v != nil { + password, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + waa.Password = password + } + case "resource": + if v != nil { + var resource string + err = json.Unmarshal(*v, &resource) + if err != nil { + return err + } + waa.Resource = &resource + } + } + } + + return nil +} + // WebActivityTypeProperties web activity type properties. type WebActivityTypeProperties struct { // Method - Rest API method for target endpoint. Possible values include: 'WebActivityMethodGET', 'WebActivityMethodPOST', 'WebActivityMethodPUT', 'WebActivityMethodDELETE'