Skip to content

Commit

Permalink
Generated from 60f4598fd519843b5b992024169d9af2eab5bdbe (#6089)
Browse files Browse the repository at this point in the history
Changed WebActivity and webhook activity auth to support both AKV and Secrets
  • Loading branch information
AutorestCI authored Oct 24, 2019
1 parent c0d9fbb commit 9a377fc
Showing 1 changed file with 60 additions and 2 deletions.
62 changes: 60 additions & 2 deletions services/datafactory/mgmt/2018-06-01/datafactory/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 9a377fc

Please sign in to comment.