// SetHasCredential sets the HasCredential field's value.
487948
func (s *APNSVoipSandboxChannelResponse) SetHasCredential(v bool) *APNSVoipSandboxChannelResponse {
	s.HasCredential = &v
	return s
}
522976
func (c *Client) AddCredential(tag string, credential jujucloud.Credential) error {
	if bestVer := c.BestAPIVersion(); bestVer < 2 {
		return errors.NotImplementedf("AddCredential() (need v2+, have v%d)", bestVer)
	}
	var results params.ErrorResults
	cloudCredential := params.CloudCredential{
		AuthType:   string(credential.AuthType()),
		Attributes: credential.Attributes(),
	}
	args := params.TaggedCredentials{
		Credentials: []params.TaggedCredential{{
			Tag:        tag,
			Credential: cloudCredential,
		},
		}}
	if err := c.facade.FacadeCall("AddCredentials", args, &results); err != nil {
		return errors.Trace(err)
	}
	return results.OneError()
}
1230801
func (s *serverConfig) SetCredential(creds auth.Credentials) (prevCred auth.Credentials) {
	if creds.IsValid() && globalActiveCred.IsValid() {
		globalActiveCred = creds
	}

	// Save previous credential.
	prevCred = s.Credential

	// Set updated credential.
	s.Credential = creds

	// Return previous credential.
	return prevCred
}
224810
func (jolokiaClient *JolokiaClient) SetCredential(userName string, pass string) {
	jolokiaClient.user = userName
	jolokiaClient.pass = pass
}
849535
func (ch *CredHub) SetCredential(name, credType string, value interface{}) (credentials.Credential, error) {
	var cred credentials.Credential
	err := ch.setCredential(name, credType, value, &cred)

	return cred, err
}
217806
func (s *CreateHsmClientCertificateOutput) SetHsmClientCertificate(v *HsmClientCertificate) *CreateHsmClientCertificateOutput {
	s.HsmClientCertificate = v
	return s
}
1283418
func (cfg *ApplicationConfigEnv) PasswordCredentials() PasswordCredentials {
	return PasswordCredentials{
		Username:  cfg.Username,
		Extension: cfg.Extension,
		Password:  cfg.Password}
}
685241
func (_m *ClientInterface) ValidateCredentials(_a0 user.User) (bool, error) {
	ret := _m.Called(_a0)

	var r0 bool
	if rf, ok := ret.Get(0).(func(user.User) bool); ok {
		r0 = rf(_a0)
	} else {
		r0 = ret.Get(0).(bool)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(user.User) error); ok {
		r1 = rf(_a0)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1274214
func (s *RotateIngestEndpointCredentialsOutput) SetHlsIngest(v *HlsIngest) *RotateIngestEndpointCredentialsOutput {
	s.HlsIngest = v
	return s
}
544750
func (s *CreateClusterInput) SetHsmClientCertificateIdentifier(v string) *CreateClusterInput {
	s.HsmClientCertificateIdentifier = &v
	return s
}
564364
func (s *Server) ValidateCredentials(someUser user.User, valid *bool) error {
	result, err := s.f.ValidateCredentials(s.context(), someUser)
	if err != nil {
		return err
	}
	*valid = result
	return nil
}
190724
func NewCredential(auth types.AuthConfig) Credential {
	// TODO 这里可以组装其他的方法
	return simple.NewBasicCredential(auth.Username, auth.Password)
}
708461
func (s *AcceptHandshakeOutput) SetHandshake(v *Handshake) *AcceptHandshakeOutput {
	s.Handshake = v
	return s
}
29095
func AsDefaultCredentials(ctx *AssertContext) {
	conf := ctx.Config
	Expect(conf).ToNot(BeNil(),
		"cannot set static AssertContext without config")

	tempFile, err := ioutil.TempFile("", "bosh-gcscli-service-account-file")
	Expect(err).ToNot(HaveOccurred())
	defer tempFile.Close()

	tempFile.WriteString(ctx.serviceAccountFile)

	ctx.serviceAccountPath = tempFile.Name()
	os.Setenv(GoogleAppCredentialsEnv, ctx.serviceAccountPath)

	conf.CredentialsSource = config.DefaultCredentialsSource
}
1187137
func (environProviderCredentials) FinalizeCredential(_ environs.FinalizeCredentialContext, args environs.FinalizeCredentialParams) (*cloud.Credential, error) {
	return &args.Credential, nil
}
65744
func (s *APNSVoipSandboxChannelResponse) SetHasTokenKey(v bool) *APNSVoipSandboxChannelResponse {
	s.HasTokenKey = &v
	return s
}
201503
func (s *Connection) SetHasLogicalRedundancy(v string) *Connection {
	s.HasLogicalRedundancy = &v
	return s
}