repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
sequence
docstring
stringlengths
6
2.61k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
85
252
partition
stringclasses
1 value
aws/aws-sdk-go
aws/credentials/plugincreds/provider.go
GetPluginProviderFns
func GetPluginProviderFns(p *plugin.Plugin) (func() (key, secret, token string, err error), func() bool, error) { return GetPluginProviderFnsByName(p, ProviderSymbolName) }
go
func GetPluginProviderFns(p *plugin.Plugin) (func() (key, secret, token string, err error), func() bool, error) { return GetPluginProviderFnsByName(p, ProviderSymbolName) }
[ "func", "GetPluginProviderFns", "(", "p", "*", "plugin", ".", "Plugin", ")", "(", "func", "(", ")", "(", "key", ",", "secret", ",", "token", "string", ",", "err", "error", ")", ",", "func", "(", ")", "bool", ",", "error", ")", "{", "return", "GetPluginProviderFnsByName", "(", "p", ",", "ProviderSymbolName", ")", "\n", "}" ]
// GetPluginProviderFns returns the plugin's Retrieve and IsExpired functions // returned by the plugin's credential provider getter. // // Uses ProviderSymbolName as the symbol name when lookup up the symbol. If you // want to use a different symbol name, use GetPluginProviderFnsByName.
[ "GetPluginProviderFns", "returns", "the", "plugin", "s", "Retrieve", "and", "IsExpired", "functions", "returned", "by", "the", "plugin", "s", "credential", "provider", "getter", ".", "Uses", "ProviderSymbolName", "as", "the", "symbol", "name", "when", "lookup", "up", "the", "symbol", ".", "If", "you", "want", "to", "use", "a", "different", "symbol", "name", "use", "GetPluginProviderFnsByName", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/aws/credentials/plugincreds/provider.go#L179-L181
train
aws/aws-sdk-go
aws/credentials/plugincreds/provider.go
GetPluginProviderFnsByName
func GetPluginProviderFnsByName(p *plugin.Plugin, symbolName string) (func() (key, secret, token string, err error), func() bool, error) { sym, err := p.Lookup(symbolName) if err != nil { return nil, nil, awserr.New(ErrCodeLookupSymbolError, fmt.Sprintf("failed to lookup %s plugin provider symbol", symbolName), err) } fn, ok := sym.(func() (func() (key, secret, token string, err error), func() bool)) if !ok { return nil, nil, awserr.New(ErrCodeInvalidSymbolError, fmt.Sprintf("symbol %T, does not match the 'func() (func() (key, secret, token string, err error), func() bool)' type", sym), nil) } retrieveFn, isExpiredFn := fn() if retrieveFn == nil { return nil, nil, awserr.New(ErrCodePluginRetrieveNil, "the plugin provider retrieve function cannot be nil", nil) } if isExpiredFn == nil { return nil, nil, awserr.New(ErrCodePluginIsExpiredNil, "the plugin provider isExpired function cannot be nil", nil) } return retrieveFn, isExpiredFn, nil }
go
func GetPluginProviderFnsByName(p *plugin.Plugin, symbolName string) (func() (key, secret, token string, err error), func() bool, error) { sym, err := p.Lookup(symbolName) if err != nil { return nil, nil, awserr.New(ErrCodeLookupSymbolError, fmt.Sprintf("failed to lookup %s plugin provider symbol", symbolName), err) } fn, ok := sym.(func() (func() (key, secret, token string, err error), func() bool)) if !ok { return nil, nil, awserr.New(ErrCodeInvalidSymbolError, fmt.Sprintf("symbol %T, does not match the 'func() (func() (key, secret, token string, err error), func() bool)' type", sym), nil) } retrieveFn, isExpiredFn := fn() if retrieveFn == nil { return nil, nil, awserr.New(ErrCodePluginRetrieveNil, "the plugin provider retrieve function cannot be nil", nil) } if isExpiredFn == nil { return nil, nil, awserr.New(ErrCodePluginIsExpiredNil, "the plugin provider isExpired function cannot be nil", nil) } return retrieveFn, isExpiredFn, nil }
[ "func", "GetPluginProviderFnsByName", "(", "p", "*", "plugin", ".", "Plugin", ",", "symbolName", "string", ")", "(", "func", "(", ")", "(", "key", ",", "secret", ",", "token", "string", ",", "err", "error", ")", ",", "func", "(", ")", "bool", ",", "error", ")", "{", "sym", ",", "err", ":=", "p", ".", "Lookup", "(", "symbolName", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "nil", ",", "awserr", ".", "New", "(", "ErrCodeLookupSymbolError", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "symbolName", ")", ",", "err", ")", "\n", "}", "\n\n", "fn", ",", "ok", ":=", "sym", ".", "(", "func", "(", ")", "(", "func", "(", ")", "(", "key", ",", "secret", ",", "token", "string", ",", "err", "error", ")", ",", "func", "(", ")", "bool", ")", ")", "\n", "if", "!", "ok", "{", "return", "nil", ",", "nil", ",", "awserr", ".", "New", "(", "ErrCodeInvalidSymbolError", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "sym", ")", ",", "nil", ")", "\n", "}", "\n\n", "retrieveFn", ",", "isExpiredFn", ":=", "fn", "(", ")", "\n", "if", "retrieveFn", "==", "nil", "{", "return", "nil", ",", "nil", ",", "awserr", ".", "New", "(", "ErrCodePluginRetrieveNil", ",", "\"", "\"", ",", "nil", ")", "\n", "}", "\n", "if", "isExpiredFn", "==", "nil", "{", "return", "nil", ",", "nil", ",", "awserr", ".", "New", "(", "ErrCodePluginIsExpiredNil", ",", "\"", "\"", ",", "nil", ")", "\n", "}", "\n\n", "return", "retrieveFn", ",", "isExpiredFn", ",", "nil", "\n", "}" ]
// GetPluginProviderFnsByName returns the plugin's Retrieve and IsExpired functions // returned by the plugin's credential provider getter. // // Same as GetPluginProviderFns, but takes a custom symbolName to lookup with.
[ "GetPluginProviderFnsByName", "returns", "the", "plugin", "s", "Retrieve", "and", "IsExpired", "functions", "returned", "by", "the", "plugin", "s", "credential", "provider", "getter", ".", "Same", "as", "GetPluginProviderFns", "but", "takes", "a", "custom", "symbolName", "to", "lookup", "with", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/aws/credentials/plugincreds/provider.go#L187-L211
train
aws/aws-sdk-go
private/util/sort_keys.go
SortedKeys
func SortedKeys(m map[string]interface{}) []string { i, sorted := 0, make([]string, len(m)) for k := range m { sorted[i] = k i++ } sort.Strings(sorted) return sorted }
go
func SortedKeys(m map[string]interface{}) []string { i, sorted := 0, make([]string, len(m)) for k := range m { sorted[i] = k i++ } sort.Strings(sorted) return sorted }
[ "func", "SortedKeys", "(", "m", "map", "[", "string", "]", "interface", "{", "}", ")", "[", "]", "string", "{", "i", ",", "sorted", ":=", "0", ",", "make", "(", "[", "]", "string", ",", "len", "(", "m", ")", ")", "\n", "for", "k", ":=", "range", "m", "{", "sorted", "[", "i", "]", "=", "k", "\n", "i", "++", "\n", "}", "\n", "sort", ".", "Strings", "(", "sorted", ")", "\n", "return", "sorted", "\n", "}" ]
// SortedKeys returns a sorted slice of keys of a map.
[ "SortedKeys", "returns", "a", "sorted", "slice", "of", "keys", "of", "a", "map", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/util/sort_keys.go#L6-L14
train
aws/aws-sdk-go
service/cloudfront/sign/sign_cookie.go
apply
func (o CookieOptions) apply(opts ...func(*CookieOptions)) CookieOptions { if len(opts) == 0 { return o } for _, opt := range opts { opt(&o) } return o }
go
func (o CookieOptions) apply(opts ...func(*CookieOptions)) CookieOptions { if len(opts) == 0 { return o } for _, opt := range opts { opt(&o) } return o }
[ "func", "(", "o", "CookieOptions", ")", "apply", "(", "opts", "...", "func", "(", "*", "CookieOptions", ")", ")", "CookieOptions", "{", "if", "len", "(", "opts", ")", "==", "0", "{", "return", "o", "\n", "}", "\n\n", "for", "_", ",", "opt", ":=", "range", "opts", "{", "opt", "(", "&", "o", ")", "\n", "}", "\n\n", "return", "o", "\n", "}" ]
// apply will integration the options provided into the base cookie options // a new copy will be returned. The base CookieOption will not be modified.
[ "apply", "will", "integration", "the", "options", "provided", "into", "the", "base", "cookie", "options", "a", "new", "copy", "will", "be", "returned", ".", "The", "base", "CookieOption", "will", "not", "be", "modified", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudfront/sign/sign_cookie.go#L30-L40
train
aws/aws-sdk-go
service/cloudfront/sign/sign_cookie.go
NewCookieSigner
func NewCookieSigner(keyID string, privKey *rsa.PrivateKey, opts ...func(*CookieOptions)) *CookieSigner { signer := &CookieSigner{ keyID: keyID, privKey: privKey, Opts: CookieOptions{}.apply(opts...), } return signer }
go
func NewCookieSigner(keyID string, privKey *rsa.PrivateKey, opts ...func(*CookieOptions)) *CookieSigner { signer := &CookieSigner{ keyID: keyID, privKey: privKey, Opts: CookieOptions{}.apply(opts...), } return signer }
[ "func", "NewCookieSigner", "(", "keyID", "string", ",", "privKey", "*", "rsa", ".", "PrivateKey", ",", "opts", "...", "func", "(", "*", "CookieOptions", ")", ")", "*", "CookieSigner", "{", "signer", ":=", "&", "CookieSigner", "{", "keyID", ":", "keyID", ",", "privKey", ":", "privKey", ",", "Opts", ":", "CookieOptions", "{", "}", ".", "apply", "(", "opts", "...", ")", ",", "}", "\n\n", "return", "signer", "\n", "}" ]
// NewCookieSigner constructs and returns a new CookieSigner to be used to for // signing Amazon CloudFront URL resources with.
[ "NewCookieSigner", "constructs", "and", "returns", "a", "new", "CookieSigner", "to", "be", "used", "to", "for", "signing", "Amazon", "CloudFront", "URL", "resources", "with", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudfront/sign/sign_cookie.go#L64-L72
train
aws/aws-sdk-go
service/cloud9/api.go
SetAutomaticStopTimeMinutes
func (s *CreateEnvironmentEC2Input) SetAutomaticStopTimeMinutes(v int64) *CreateEnvironmentEC2Input { s.AutomaticStopTimeMinutes = &v return s }
go
func (s *CreateEnvironmentEC2Input) SetAutomaticStopTimeMinutes(v int64) *CreateEnvironmentEC2Input { s.AutomaticStopTimeMinutes = &v return s }
[ "func", "(", "s", "*", "CreateEnvironmentEC2Input", ")", "SetAutomaticStopTimeMinutes", "(", "v", "int64", ")", "*", "CreateEnvironmentEC2Input", "{", "s", ".", "AutomaticStopTimeMinutes", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetAutomaticStopTimeMinutes sets the AutomaticStopTimeMinutes field's value.
[ "SetAutomaticStopTimeMinutes", "sets", "the", "AutomaticStopTimeMinutes", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloud9/api.go#L1180-L1183
train
aws/aws-sdk-go
service/cloud9/api.go
SetMemberships
func (s *DescribeEnvironmentMembershipsOutput) SetMemberships(v []*EnvironmentMember) *DescribeEnvironmentMembershipsOutput { s.Memberships = v return s }
go
func (s *DescribeEnvironmentMembershipsOutput) SetMemberships(v []*EnvironmentMember) *DescribeEnvironmentMembershipsOutput { s.Memberships = v return s }
[ "func", "(", "s", "*", "DescribeEnvironmentMembershipsOutput", ")", "SetMemberships", "(", "v", "[", "]", "*", "EnvironmentMember", ")", "*", "DescribeEnvironmentMembershipsOutput", "{", "s", ".", "Memberships", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetMemberships sets the Memberships field's value.
[ "SetMemberships", "sets", "the", "Memberships", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloud9/api.go#L1557-L1560
train
aws/aws-sdk-go
service/cloud9/api.go
SetFailureResource
func (s *EnvironmentLifecycle) SetFailureResource(v string) *EnvironmentLifecycle { s.FailureResource = &v return s }
go
func (s *EnvironmentLifecycle) SetFailureResource(v string) *EnvironmentLifecycle { s.FailureResource = &v return s }
[ "func", "(", "s", "*", "EnvironmentLifecycle", ")", "SetFailureResource", "(", "v", "string", ")", "*", "EnvironmentLifecycle", "{", "s", ".", "FailureResource", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetFailureResource sets the FailureResource field's value.
[ "SetFailureResource", "sets", "the", "FailureResource", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloud9/api.go#L1832-L1835
train
aws/aws-sdk-go
service/cloud9/api.go
SetLastAccess
func (s *EnvironmentMember) SetLastAccess(v time.Time) *EnvironmentMember { s.LastAccess = &v return s }
go
func (s *EnvironmentMember) SetLastAccess(v time.Time) *EnvironmentMember { s.LastAccess = &v return s }
[ "func", "(", "s", "*", "EnvironmentMember", ")", "SetLastAccess", "(", "v", "time", ".", "Time", ")", "*", "EnvironmentMember", "{", "s", ".", "LastAccess", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetLastAccess sets the LastAccess field's value.
[ "SetLastAccess", "sets", "the", "LastAccess", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloud9/api.go#L1895-L1898
train
aws/aws-sdk-go
aws/awsutil/equal.go
DeepEqual
func DeepEqual(a, b interface{}) bool { ra := reflect.Indirect(reflect.ValueOf(a)) rb := reflect.Indirect(reflect.ValueOf(b)) if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { // If the elements are both nil, and of the same type they are equal // If they are of different types they are not equal return reflect.TypeOf(a) == reflect.TypeOf(b) } else if raValid != rbValid { // Both values must be valid to be equal return false } return reflect.DeepEqual(ra.Interface(), rb.Interface()) }
go
func DeepEqual(a, b interface{}) bool { ra := reflect.Indirect(reflect.ValueOf(a)) rb := reflect.Indirect(reflect.ValueOf(b)) if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { // If the elements are both nil, and of the same type they are equal // If they are of different types they are not equal return reflect.TypeOf(a) == reflect.TypeOf(b) } else if raValid != rbValid { // Both values must be valid to be equal return false } return reflect.DeepEqual(ra.Interface(), rb.Interface()) }
[ "func", "DeepEqual", "(", "a", ",", "b", "interface", "{", "}", ")", "bool", "{", "ra", ":=", "reflect", ".", "Indirect", "(", "reflect", ".", "ValueOf", "(", "a", ")", ")", "\n", "rb", ":=", "reflect", ".", "Indirect", "(", "reflect", ".", "ValueOf", "(", "b", ")", ")", "\n\n", "if", "raValid", ",", "rbValid", ":=", "ra", ".", "IsValid", "(", ")", ",", "rb", ".", "IsValid", "(", ")", ";", "!", "raValid", "&&", "!", "rbValid", "{", "// If the elements are both nil, and of the same type they are equal", "// If they are of different types they are not equal", "return", "reflect", ".", "TypeOf", "(", "a", ")", "==", "reflect", ".", "TypeOf", "(", "b", ")", "\n", "}", "else", "if", "raValid", "!=", "rbValid", "{", "// Both values must be valid to be equal", "return", "false", "\n", "}", "\n\n", "return", "reflect", ".", "DeepEqual", "(", "ra", ".", "Interface", "(", ")", ",", "rb", ".", "Interface", "(", ")", ")", "\n", "}" ]
// DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. // In addition to this, this method will also dereference the input values if // possible so the DeepEqual performed will not fail if one parameter is a // pointer and the other is not. // // DeepEqual will not perform indirection of nested values of the input parameters.
[ "DeepEqual", "returns", "if", "the", "two", "values", "are", "deeply", "equal", "like", "reflect", ".", "DeepEqual", ".", "In", "addition", "to", "this", "this", "method", "will", "also", "dereference", "the", "input", "values", "if", "possible", "so", "the", "DeepEqual", "performed", "will", "not", "fail", "if", "one", "parameter", "is", "a", "pointer", "and", "the", "other", "is", "not", ".", "DeepEqual", "will", "not", "perform", "indirection", "of", "nested", "values", "of", "the", "input", "parameters", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/aws/awsutil/equal.go#L13-L27
train
aws/aws-sdk-go
private/model/api/shape.go
CanBeEmpty
func (ref *ShapeRef) CanBeEmpty() bool { switch ref.Shape.Type { case "string": return !(ref.Location == "uri" || ref.HostLabel) case "blob", "map", "list": return !(ref.Location == "uri") default: return true } }
go
func (ref *ShapeRef) CanBeEmpty() bool { switch ref.Shape.Type { case "string": return !(ref.Location == "uri" || ref.HostLabel) case "blob", "map", "list": return !(ref.Location == "uri") default: return true } }
[ "func", "(", "ref", "*", "ShapeRef", ")", "CanBeEmpty", "(", ")", "bool", "{", "switch", "ref", ".", "Shape", ".", "Type", "{", "case", "\"", "\"", ":", "return", "!", "(", "ref", ".", "Location", "==", "\"", "\"", "||", "ref", ".", "HostLabel", ")", "\n", "case", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ":", "return", "!", "(", "ref", ".", "Location", "==", "\"", "\"", ")", "\n", "default", ":", "return", "true", "\n", "}", "\n", "}" ]
// CanBeEmpty returns if the shape value can sent request as an empty value. // String, blob, list, and map are types must not be empty when the member is // serialized to the uri path, or decorated with HostLabel.
[ "CanBeEmpty", "returns", "if", "the", "shape", "value", "can", "sent", "request", "as", "an", "empty", "value", ".", "String", "blob", "list", "and", "map", "are", "types", "must", "not", "be", "empty", "when", "the", "member", "is", "serialized", "to", "the", "uri", "path", "or", "decorated", "with", "HostLabel", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L120-L129
train
aws/aws-sdk-go
private/model/api/shape.go
ErrorName
func (s *Shape) ErrorName() string { name := s.ErrorInfo.Type switch s.API.Metadata.Protocol { case "query", "ec2query", "rest-xml": if len(s.ErrorInfo.Code) > 0 { name = s.ErrorInfo.Code } } if len(name) == 0 { name = s.OrigShapeName } if len(name) == 0 { name = s.ShapeName } return name }
go
func (s *Shape) ErrorName() string { name := s.ErrorInfo.Type switch s.API.Metadata.Protocol { case "query", "ec2query", "rest-xml": if len(s.ErrorInfo.Code) > 0 { name = s.ErrorInfo.Code } } if len(name) == 0 { name = s.OrigShapeName } if len(name) == 0 { name = s.ShapeName } return name }
[ "func", "(", "s", "*", "Shape", ")", "ErrorName", "(", ")", "string", "{", "name", ":=", "s", ".", "ErrorInfo", ".", "Type", "\n", "switch", "s", ".", "API", ".", "Metadata", ".", "Protocol", "{", "case", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ":", "if", "len", "(", "s", ".", "ErrorInfo", ".", "Code", ")", ">", "0", "{", "name", "=", "s", ".", "ErrorInfo", ".", "Code", "\n", "}", "\n", "}", "\n\n", "if", "len", "(", "name", ")", "==", "0", "{", "name", "=", "s", ".", "OrigShapeName", "\n", "}", "\n", "if", "len", "(", "name", ")", "==", "0", "{", "name", "=", "s", ".", "ShapeName", "\n", "}", "\n\n", "return", "name", "\n", "}" ]
// ErrorName will return the shape's name or error code if available based // on the API's protocol. This is the error code string returned by the service.
[ "ErrorName", "will", "return", "the", "shape", "s", "name", "or", "error", "code", "if", "available", "based", "on", "the", "API", "s", "protocol", ".", "This", "is", "the", "error", "code", "string", "returned", "by", "the", "service", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L139-L156
train
aws/aws-sdk-go
private/model/api/shape.go
PayloadRefName
func (s *Shape) PayloadRefName() string { if name := s.Payload; len(name) != 0 { // Root shape return name } for name, ref := range s.MemberRefs { if ref.IsEventPayload { return name } } return "" }
go
func (s *Shape) PayloadRefName() string { if name := s.Payload; len(name) != 0 { // Root shape return name } for name, ref := range s.MemberRefs { if ref.IsEventPayload { return name } } return "" }
[ "func", "(", "s", "*", "Shape", ")", "PayloadRefName", "(", ")", "string", "{", "if", "name", ":=", "s", ".", "Payload", ";", "len", "(", "name", ")", "!=", "0", "{", "// Root shape", "return", "name", "\n", "}", "\n\n", "for", "name", ",", "ref", ":=", "range", "s", ".", "MemberRefs", "{", "if", "ref", ".", "IsEventPayload", "{", "return", "name", "\n", "}", "\n", "}", "\n\n", "return", "\"", "\"", "\n", "}" ]
// PayloadRefName returns the payload member of the shape if there is one // modeled. If no payload is modeled, empty string will be returned.
[ "PayloadRefName", "returns", "the", "payload", "member", "of", "the", "shape", "if", "there", "is", "one", "modeled", ".", "If", "no", "payload", "is", "modeled", "empty", "string", "will", "be", "returned", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L160-L173
train
aws/aws-sdk-go
private/model/api/shape.go
GoTags
func (s *Shape) GoTags(root, required bool) string { ref := &ShapeRef{ShapeName: s.ShapeName, API: s.API, Shape: s} return ref.GoTags(root, required) }
go
func (s *Shape) GoTags(root, required bool) string { ref := &ShapeRef{ShapeName: s.ShapeName, API: s.API, Shape: s} return ref.GoTags(root, required) }
[ "func", "(", "s", "*", "Shape", ")", "GoTags", "(", "root", ",", "required", "bool", ")", "string", "{", "ref", ":=", "&", "ShapeRef", "{", "ShapeName", ":", "s", ".", "ShapeName", ",", "API", ":", "s", ".", "API", ",", "Shape", ":", "s", "}", "\n", "return", "ref", ".", "GoTags", "(", "root", ",", "required", ")", "\n", "}" ]
// GoTags returns the struct tags for a shape.
[ "GoTags", "returns", "the", "struct", "tags", "for", "a", "shape", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L176-L179
train
aws/aws-sdk-go
private/model/api/shape.go
Rename
func (s *Shape) Rename(newName string) { if s.AliasedShapeName { panic(fmt.Sprintf("attempted to rename %s, but flagged as aliased", s.ShapeName)) } for _, r := range s.refs { r.OrigShapeName = r.ShapeName r.ShapeName = newName } delete(s.API.Shapes, s.ShapeName) s.OrigShapeName = s.ShapeName s.API.Shapes[newName] = s s.ShapeName = newName }
go
func (s *Shape) Rename(newName string) { if s.AliasedShapeName { panic(fmt.Sprintf("attempted to rename %s, but flagged as aliased", s.ShapeName)) } for _, r := range s.refs { r.OrigShapeName = r.ShapeName r.ShapeName = newName } delete(s.API.Shapes, s.ShapeName) s.OrigShapeName = s.ShapeName s.API.Shapes[newName] = s s.ShapeName = newName }
[ "func", "(", "s", "*", "Shape", ")", "Rename", "(", "newName", "string", ")", "{", "if", "s", ".", "AliasedShapeName", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "s", ".", "ShapeName", ")", ")", "\n", "}", "\n\n", "for", "_", ",", "r", ":=", "range", "s", ".", "refs", "{", "r", ".", "OrigShapeName", "=", "r", ".", "ShapeName", "\n", "r", ".", "ShapeName", "=", "newName", "\n", "}", "\n\n", "delete", "(", "s", ".", "API", ".", "Shapes", ",", "s", ".", "ShapeName", ")", "\n", "s", ".", "OrigShapeName", "=", "s", ".", "ShapeName", "\n", "s", ".", "API", ".", "Shapes", "[", "newName", "]", "=", "s", "\n", "s", ".", "ShapeName", "=", "newName", "\n", "}" ]
// Rename changes the name of the Shape to newName. Also updates // the associated API's reference to use newName.
[ "Rename", "changes", "the", "name", "of", "the", "Shape", "to", "newName", ".", "Also", "updates", "the", "associated", "API", "s", "reference", "to", "use", "newName", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L183-L198
train
aws/aws-sdk-go
private/model/api/shape.go
MemberNames
func (s *Shape) MemberNames() []string { i, names := 0, make([]string, len(s.MemberRefs)) for n := range s.MemberRefs { names[i] = n i++ } sort.Strings(names) return names }
go
func (s *Shape) MemberNames() []string { i, names := 0, make([]string, len(s.MemberRefs)) for n := range s.MemberRefs { names[i] = n i++ } sort.Strings(names) return names }
[ "func", "(", "s", "*", "Shape", ")", "MemberNames", "(", ")", "[", "]", "string", "{", "i", ",", "names", ":=", "0", ",", "make", "(", "[", "]", "string", ",", "len", "(", "s", ".", "MemberRefs", ")", ")", "\n", "for", "n", ":=", "range", "s", ".", "MemberRefs", "{", "names", "[", "i", "]", "=", "n", "\n", "i", "++", "\n", "}", "\n", "sort", ".", "Strings", "(", "names", ")", "\n", "return", "names", "\n", "}" ]
// MemberNames returns a slice of struct member names.
[ "MemberNames", "returns", "a", "slice", "of", "struct", "member", "names", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L201-L209
train
aws/aws-sdk-go
private/model/api/shape.go
HasMember
func (s *Shape) HasMember(name string) bool { _, ok := s.MemberRefs[name] return ok }
go
func (s *Shape) HasMember(name string) bool { _, ok := s.MemberRefs[name] return ok }
[ "func", "(", "s", "*", "Shape", ")", "HasMember", "(", "name", "string", ")", "bool", "{", "_", ",", "ok", ":=", "s", ".", "MemberRefs", "[", "name", "]", "\n", "return", "ok", "\n", "}" ]
// HasMember will return whether or not the shape has a given // member by name.
[ "HasMember", "will", "return", "whether", "or", "not", "the", "shape", "has", "a", "given", "member", "by", "name", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L213-L216
train
aws/aws-sdk-go
private/model/api/shape.go
UseIndirection
func (s *ShapeRef) UseIndirection() bool { switch s.Shape.Type { case "map", "list", "blob", "structure", "jsonvalue": return false } if s.Streaming || s.Shape.Streaming { return false } if s.JSONValue { return false } return true }
go
func (s *ShapeRef) UseIndirection() bool { switch s.Shape.Type { case "map", "list", "blob", "structure", "jsonvalue": return false } if s.Streaming || s.Shape.Streaming { return false } if s.JSONValue { return false } return true }
[ "func", "(", "s", "*", "ShapeRef", ")", "UseIndirection", "(", ")", "bool", "{", "switch", "s", ".", "Shape", ".", "Type", "{", "case", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ":", "return", "false", "\n", "}", "\n\n", "if", "s", ".", "Streaming", "||", "s", ".", "Shape", ".", "Streaming", "{", "return", "false", "\n", "}", "\n\n", "if", "s", ".", "JSONValue", "{", "return", "false", "\n", "}", "\n\n", "return", "true", "\n", "}" ]
// UseIndirection returns if the shape's reference should use indirection or not.
[ "UseIndirection", "returns", "if", "the", "shape", "s", "reference", "should", "use", "indirection", "or", "not", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L235-L250
train
aws/aws-sdk-go
private/model/api/shape.go
GoStructValueType
func (s *Shape) GoStructValueType(name string, ref *ShapeRef) string { v := s.GoStructType(name, ref) if ref.UseIndirection() && v[0] == '*' { return v[1:] } return v }
go
func (s *Shape) GoStructValueType(name string, ref *ShapeRef) string { v := s.GoStructType(name, ref) if ref.UseIndirection() && v[0] == '*' { return v[1:] } return v }
[ "func", "(", "s", "*", "Shape", ")", "GoStructValueType", "(", "name", "string", ",", "ref", "*", "ShapeRef", ")", "string", "{", "v", ":=", "s", ".", "GoStructType", "(", "name", ",", "ref", ")", "\n\n", "if", "ref", ".", "UseIndirection", "(", ")", "&&", "v", "[", "0", "]", "==", "'*'", "{", "return", "v", "[", "1", ":", "]", "\n", "}", "\n\n", "return", "v", "\n", "}" ]
// GoStructValueType returns the Shape's Go type value instead of a pointer // for the type.
[ "GoStructValueType", "returns", "the", "Shape", "s", "Go", "type", "value", "instead", "of", "a", "pointer", "for", "the", "type", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L280-L288
train
aws/aws-sdk-go
private/model/api/shape.go
GoStructType
func (s *Shape) GoStructType(name string, ref *ShapeRef) string { if (ref.Streaming || ref.Shape.Streaming) && s.Payload == name { rtype := "io.ReadSeeker" if strings.HasSuffix(s.ShapeName, "Output") { rtype = "io.ReadCloser" } s.API.imports["io"] = true return rtype } if ref.JSONValue { s.API.AddSDKImport("aws") return "aws.JSONValue" } for _, v := range s.Validations { // TODO move this to shape validation resolution if (v.Ref.Shape.Type == "map" || v.Ref.Shape.Type == "list") && v.Type == ShapeValidationNested { s.API.imports["fmt"] = true } } return ref.GoType() }
go
func (s *Shape) GoStructType(name string, ref *ShapeRef) string { if (ref.Streaming || ref.Shape.Streaming) && s.Payload == name { rtype := "io.ReadSeeker" if strings.HasSuffix(s.ShapeName, "Output") { rtype = "io.ReadCloser" } s.API.imports["io"] = true return rtype } if ref.JSONValue { s.API.AddSDKImport("aws") return "aws.JSONValue" } for _, v := range s.Validations { // TODO move this to shape validation resolution if (v.Ref.Shape.Type == "map" || v.Ref.Shape.Type == "list") && v.Type == ShapeValidationNested { s.API.imports["fmt"] = true } } return ref.GoType() }
[ "func", "(", "s", "*", "Shape", ")", "GoStructType", "(", "name", "string", ",", "ref", "*", "ShapeRef", ")", "string", "{", "if", "(", "ref", ".", "Streaming", "||", "ref", ".", "Shape", ".", "Streaming", ")", "&&", "s", ".", "Payload", "==", "name", "{", "rtype", ":=", "\"", "\"", "\n", "if", "strings", ".", "HasSuffix", "(", "s", ".", "ShapeName", ",", "\"", "\"", ")", "{", "rtype", "=", "\"", "\"", "\n", "}", "\n\n", "s", ".", "API", ".", "imports", "[", "\"", "\"", "]", "=", "true", "\n", "return", "rtype", "\n", "}", "\n\n", "if", "ref", ".", "JSONValue", "{", "s", ".", "API", ".", "AddSDKImport", "(", "\"", "\"", ")", "\n", "return", "\"", "\"", "\n", "}", "\n\n", "for", "_", ",", "v", ":=", "range", "s", ".", "Validations", "{", "// TODO move this to shape validation resolution", "if", "(", "v", ".", "Ref", ".", "Shape", ".", "Type", "==", "\"", "\"", "||", "v", ".", "Ref", ".", "Shape", ".", "Type", "==", "\"", "\"", ")", "&&", "v", ".", "Type", "==", "ShapeValidationNested", "{", "s", ".", "API", ".", "imports", "[", "\"", "\"", "]", "=", "true", "\n", "}", "\n", "}", "\n\n", "return", "ref", ".", "GoType", "(", ")", "\n", "}" ]
// GoStructType returns the type of a struct field based on the API // model definition.
[ "GoStructType", "returns", "the", "type", "of", "a", "struct", "field", "based", "on", "the", "API", "model", "definition", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L292-L316
train
aws/aws-sdk-go
private/model/api/shape.go
goType
func goType(s *Shape, withPkgName bool) string { switch s.Type { case "structure": if withPkgName || s.resolvePkg != "" { pkg := s.resolvePkg if pkg != "" { s.API.imports[pkg] = true pkg = path.Base(pkg) } else { pkg = s.API.PackageName() } return fmt.Sprintf("*%s.%s", pkg, s.ShapeName) } return "*" + s.ShapeName case "map": return "map[string]" + goType(s.ValueRef.Shape, withPkgName) case "jsonvalue": return "aws.JSONValue" case "list": return "[]" + goType(s.MemberRef.Shape, withPkgName) case "boolean": return "*bool" case "string", "character": return "*string" case "blob": return "[]byte" case "byte", "short", "integer", "long": return "*int64" case "float", "double": return "*float64" case "timestamp": s.API.imports["time"] = true return "*time.Time" default: panic("Unsupported shape type: " + s.Type) } }
go
func goType(s *Shape, withPkgName bool) string { switch s.Type { case "structure": if withPkgName || s.resolvePkg != "" { pkg := s.resolvePkg if pkg != "" { s.API.imports[pkg] = true pkg = path.Base(pkg) } else { pkg = s.API.PackageName() } return fmt.Sprintf("*%s.%s", pkg, s.ShapeName) } return "*" + s.ShapeName case "map": return "map[string]" + goType(s.ValueRef.Shape, withPkgName) case "jsonvalue": return "aws.JSONValue" case "list": return "[]" + goType(s.MemberRef.Shape, withPkgName) case "boolean": return "*bool" case "string", "character": return "*string" case "blob": return "[]byte" case "byte", "short", "integer", "long": return "*int64" case "float", "double": return "*float64" case "timestamp": s.API.imports["time"] = true return "*time.Time" default: panic("Unsupported shape type: " + s.Type) } }
[ "func", "goType", "(", "s", "*", "Shape", ",", "withPkgName", "bool", ")", "string", "{", "switch", "s", ".", "Type", "{", "case", "\"", "\"", ":", "if", "withPkgName", "||", "s", ".", "resolvePkg", "!=", "\"", "\"", "{", "pkg", ":=", "s", ".", "resolvePkg", "\n", "if", "pkg", "!=", "\"", "\"", "{", "s", ".", "API", ".", "imports", "[", "pkg", "]", "=", "true", "\n", "pkg", "=", "path", ".", "Base", "(", "pkg", ")", "\n", "}", "else", "{", "pkg", "=", "s", ".", "API", ".", "PackageName", "(", ")", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "pkg", ",", "s", ".", "ShapeName", ")", "\n", "}", "\n", "return", "\"", "\"", "+", "s", ".", "ShapeName", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "+", "goType", "(", "s", ".", "ValueRef", ".", "Shape", ",", "withPkgName", ")", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "+", "goType", "(", "s", ".", "MemberRef", ".", "Shape", ",", "withPkgName", ")", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ",", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ",", "\"", "\"", ":", "return", "\"", "\"", "\n", "case", "\"", "\"", ":", "s", ".", "API", ".", "imports", "[", "\"", "\"", "]", "=", "true", "\n", "return", "\"", "\"", "\n", "default", ":", "panic", "(", "\"", "\"", "+", "s", ".", "Type", ")", "\n", "}", "\n", "}" ]
// Returns a string version of the Shape's type. // If withPkgName is true, the package name will be added as a prefix
[ "Returns", "a", "string", "version", "of", "the", "Shape", "s", "type", ".", "If", "withPkgName", "is", "true", "the", "package", "name", "will", "be", "added", "as", "a", "prefix" ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L344-L380
train
aws/aws-sdk-go
private/model/api/shape.go
String
func (s ShapeTag) String() string { return fmt.Sprintf(`%s:"%s"`, s.Key, s.Val) }
go
func (s ShapeTag) String() string { return fmt.Sprintf(`%s:"%s"`, s.Key, s.Val) }
[ "func", "(", "s", "ShapeTag", ")", "String", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "`%s:\"%s\"`", ",", "s", ".", "Key", ",", "s", ".", "Val", ")", "\n", "}" ]
// String returns the string representation of the shape tag
[ "String", "returns", "the", "string", "representation", "of", "the", "shape", "tag" ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L408-L410
train
aws/aws-sdk-go
private/model/api/shape.go
Join
func (s ShapeTags) Join(sep string) string { o := &bytes.Buffer{} for i, t := range s { o.WriteString(t.String()) if i < len(s)-1 { o.WriteString(sep) } } return o.String() }
go
func (s ShapeTags) Join(sep string) string { o := &bytes.Buffer{} for i, t := range s { o.WriteString(t.String()) if i < len(s)-1 { o.WriteString(sep) } } return o.String() }
[ "func", "(", "s", "ShapeTags", ")", "Join", "(", "sep", "string", ")", "string", "{", "o", ":=", "&", "bytes", ".", "Buffer", "{", "}", "\n", "for", "i", ",", "t", ":=", "range", "s", "{", "o", ".", "WriteString", "(", "t", ".", "String", "(", ")", ")", "\n", "if", "i", "<", "len", "(", "s", ")", "-", "1", "{", "o", ".", "WriteString", "(", "sep", ")", "\n", "}", "\n", "}", "\n\n", "return", "o", ".", "String", "(", ")", "\n", "}" ]
// Join returns an ordered serialization of the shape tags with the provided // separator.
[ "Join", "returns", "an", "ordered", "serialization", "of", "the", "shape", "tags", "with", "the", "provided", "separator", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L418-L428
train
aws/aws-sdk-go
private/model/api/shape.go
Docstring
func (ref *ShapeRef) Docstring() string { if ref.Documentation != "" { return strings.Trim(ref.Documentation, "\n ") } return ref.Shape.Docstring() }
go
func (ref *ShapeRef) Docstring() string { if ref.Documentation != "" { return strings.Trim(ref.Documentation, "\n ") } return ref.Shape.Docstring() }
[ "func", "(", "ref", "*", "ShapeRef", ")", "Docstring", "(", ")", "string", "{", "if", "ref", ".", "Documentation", "!=", "\"", "\"", "{", "return", "strings", ".", "Trim", "(", "ref", ".", "Documentation", ",", "\"", "\\n", "\"", ")", "\n", "}", "\n", "return", "ref", ".", "Shape", ".", "Docstring", "(", ")", "\n", "}" ]
// Docstring returns the godocs formated documentation
[ "Docstring", "returns", "the", "godocs", "formated", "documentation" ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L536-L541
train
aws/aws-sdk-go
private/model/api/shape.go
IndentedDocstring
func (ref *ShapeRef) IndentedDocstring() string { doc := ref.Docstring() return strings.Replace(doc, "// ", "// ", -1) }
go
func (ref *ShapeRef) IndentedDocstring() string { doc := ref.Docstring() return strings.Replace(doc, "// ", "// ", -1) }
[ "func", "(", "ref", "*", "ShapeRef", ")", "IndentedDocstring", "(", ")", "string", "{", "doc", ":=", "ref", ".", "Docstring", "(", ")", "\n", "return", "strings", ".", "Replace", "(", "doc", ",", "\"", "\"", ",", "\"", "\"", ",", "-", "1", ")", "\n", "}" ]
// IndentedDocstring is the indented form of the doc string.
[ "IndentedDocstring", "is", "the", "indented", "form", "of", "the", "doc", "string", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L549-L552
train
aws/aws-sdk-go
private/model/api/shape.go
EnumName
func (s *Shape) EnumName(n int) string { enum := s.Enum[n] enum = enumStrip.ReplaceAllLiteralString(enum, "") enum = enumCamelCase.ReplaceAllString(enum, "$1-$2") parts := enumDelims.Split(enum, -1) for i, v := range parts { v = strings.ToLower(v) parts[i] = "" if len(v) > 0 { parts[i] = strings.ToUpper(v[0:1]) } if len(v) > 1 { parts[i] += v[1:] } } enum = strings.Join(parts, "") enum = strings.ToUpper(enum[0:1]) + enum[1:] return enum }
go
func (s *Shape) EnumName(n int) string { enum := s.Enum[n] enum = enumStrip.ReplaceAllLiteralString(enum, "") enum = enumCamelCase.ReplaceAllString(enum, "$1-$2") parts := enumDelims.Split(enum, -1) for i, v := range parts { v = strings.ToLower(v) parts[i] = "" if len(v) > 0 { parts[i] = strings.ToUpper(v[0:1]) } if len(v) > 1 { parts[i] += v[1:] } } enum = strings.Join(parts, "") enum = strings.ToUpper(enum[0:1]) + enum[1:] return enum }
[ "func", "(", "s", "*", "Shape", ")", "EnumName", "(", "n", "int", ")", "string", "{", "enum", ":=", "s", ".", "Enum", "[", "n", "]", "\n", "enum", "=", "enumStrip", ".", "ReplaceAllLiteralString", "(", "enum", ",", "\"", "\"", ")", "\n", "enum", "=", "enumCamelCase", ".", "ReplaceAllString", "(", "enum", ",", "\"", "\"", ")", "\n", "parts", ":=", "enumDelims", ".", "Split", "(", "enum", ",", "-", "1", ")", "\n", "for", "i", ",", "v", ":=", "range", "parts", "{", "v", "=", "strings", ".", "ToLower", "(", "v", ")", "\n", "parts", "[", "i", "]", "=", "\"", "\"", "\n", "if", "len", "(", "v", ")", ">", "0", "{", "parts", "[", "i", "]", "=", "strings", ".", "ToUpper", "(", "v", "[", "0", ":", "1", "]", ")", "\n", "}", "\n", "if", "len", "(", "v", ")", ">", "1", "{", "parts", "[", "i", "]", "+=", "v", "[", "1", ":", "]", "\n", "}", "\n", "}", "\n", "enum", "=", "strings", ".", "Join", "(", "parts", ",", "\"", "\"", ")", "\n", "enum", "=", "strings", ".", "ToUpper", "(", "enum", "[", "0", ":", "1", "]", ")", "+", "enum", "[", "1", ":", "]", "\n", "return", "enum", "\n", "}" ]
// EnumName returns the Nth enum in the shapes Enum list
[ "EnumName", "returns", "the", "Nth", "enum", "in", "the", "shapes", "Enum", "list" ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L580-L598
train
aws/aws-sdk-go
private/model/api/shape.go
GoCode
func (s *Shape) GoCode() string { w := &bytes.Buffer{} switch { case s.EventStreamAPI != nil: if err := renderEventStreamAPIShape(w, s); err != nil { panic( fmt.Sprintf( "failed to generate eventstream API shape, %s, %v", s.ShapeName, err), ) } case s.Type == "structure": if err := structShapeTmpl.Execute(w, s); err != nil { panic( fmt.Sprintf( "Failed to generate struct shape %s, %v", s.ShapeName, err), ) } case s.IsEnum(): if err := enumShapeTmpl.Execute(w, s); err != nil { panic( fmt.Sprintf( "Failed to generate enum shape %s, %v", s.ShapeName, err), ) } default: panic(fmt.Sprintln("Cannot generate toplevel shape for", s.Type)) } return w.String() }
go
func (s *Shape) GoCode() string { w := &bytes.Buffer{} switch { case s.EventStreamAPI != nil: if err := renderEventStreamAPIShape(w, s); err != nil { panic( fmt.Sprintf( "failed to generate eventstream API shape, %s, %v", s.ShapeName, err), ) } case s.Type == "structure": if err := structShapeTmpl.Execute(w, s); err != nil { panic( fmt.Sprintf( "Failed to generate struct shape %s, %v", s.ShapeName, err), ) } case s.IsEnum(): if err := enumShapeTmpl.Execute(w, s); err != nil { panic( fmt.Sprintf( "Failed to generate enum shape %s, %v", s.ShapeName, err), ) } default: panic(fmt.Sprintln("Cannot generate toplevel shape for", s.Type)) } return w.String() }
[ "func", "(", "s", "*", "Shape", ")", "GoCode", "(", ")", "string", "{", "w", ":=", "&", "bytes", ".", "Buffer", "{", "}", "\n\n", "switch", "{", "case", "s", ".", "EventStreamAPI", "!=", "nil", ":", "if", "err", ":=", "renderEventStreamAPIShape", "(", "w", ",", "s", ")", ";", "err", "!=", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "s", ".", "ShapeName", ",", "err", ")", ",", ")", "\n", "}", "\n", "case", "s", ".", "Type", "==", "\"", "\"", ":", "if", "err", ":=", "structShapeTmpl", ".", "Execute", "(", "w", ",", "s", ")", ";", "err", "!=", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "s", ".", "ShapeName", ",", "err", ")", ",", ")", "\n", "}", "\n", "case", "s", ".", "IsEnum", "(", ")", ":", "if", "err", ":=", "enumShapeTmpl", ".", "Execute", "(", "w", ",", "s", ")", ";", "err", "!=", "nil", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "s", ".", "ShapeName", ",", "err", ")", ",", ")", "\n", "}", "\n", "default", ":", "panic", "(", "fmt", ".", "Sprintln", "(", "\"", "\"", ",", "s", ".", "Type", ")", ")", "\n", "}", "\n\n", "return", "w", ".", "String", "(", ")", "\n", "}" ]
// GoCode returns the rendered Go code for the Shape.
[ "GoCode", "returns", "the", "rendered", "Go", "code", "for", "the", "Shape", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L766-L799
train
aws/aws-sdk-go
private/model/api/shape.go
IsRequired
func (s *Shape) IsRequired(member string) bool { ref, ok := s.MemberRefs[member] if !ok { panic(fmt.Sprintf( "attempted to check required for unknown member, %s.%s", s.ShapeName, member, )) } if ref.IdempotencyToken || ref.Shape.IdempotencyToken { return false } if ref.Location == "uri" || ref.HostLabel { return true } for _, n := range s.Required { if n == member { return true } } return false }
go
func (s *Shape) IsRequired(member string) bool { ref, ok := s.MemberRefs[member] if !ok { panic(fmt.Sprintf( "attempted to check required for unknown member, %s.%s", s.ShapeName, member, )) } if ref.IdempotencyToken || ref.Shape.IdempotencyToken { return false } if ref.Location == "uri" || ref.HostLabel { return true } for _, n := range s.Required { if n == member { return true } } return false }
[ "func", "(", "s", "*", "Shape", ")", "IsRequired", "(", "member", "string", ")", "bool", "{", "ref", ",", "ok", ":=", "s", ".", "MemberRefs", "[", "member", "]", "\n", "if", "!", "ok", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "s", ".", "ShapeName", ",", "member", ",", ")", ")", "\n", "}", "\n", "if", "ref", ".", "IdempotencyToken", "||", "ref", ".", "Shape", ".", "IdempotencyToken", "{", "return", "false", "\n", "}", "\n", "if", "ref", ".", "Location", "==", "\"", "\"", "||", "ref", ".", "HostLabel", "{", "return", "true", "\n", "}", "\n", "for", "_", ",", "n", ":=", "range", "s", ".", "Required", "{", "if", "n", "==", "member", "{", "return", "true", "\n", "}", "\n", "}", "\n", "return", "false", "\n", "}" ]
// IsRequired returns if member is a required field. Required fields are fields // marked as required, hostLabels, or location of uri path.
[ "IsRequired", "returns", "if", "member", "is", "a", "required", "field", ".", "Required", "fields", "are", "fields", "marked", "as", "required", "hostLabels", "or", "location", "of", "uri", "path", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L808-L828
train
aws/aws-sdk-go
private/model/api/shape.go
removeRef
func (s *Shape) removeRef(ref *ShapeRef) { r := s.refs for i := 0; i < len(r); i++ { if r[i] == ref { j := i + 1 copy(r[i:], r[j:]) for k, n := len(r)-j+i, len(r); k < n; k++ { r[k] = nil // free up the end of the list } // for k s.refs = r[:len(r)-j+i] break } } }
go
func (s *Shape) removeRef(ref *ShapeRef) { r := s.refs for i := 0; i < len(r); i++ { if r[i] == ref { j := i + 1 copy(r[i:], r[j:]) for k, n := len(r)-j+i, len(r); k < n; k++ { r[k] = nil // free up the end of the list } // for k s.refs = r[:len(r)-j+i] break } } }
[ "func", "(", "s", "*", "Shape", ")", "removeRef", "(", "ref", "*", "ShapeRef", ")", "{", "r", ":=", "s", ".", "refs", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "r", ")", ";", "i", "++", "{", "if", "r", "[", "i", "]", "==", "ref", "{", "j", ":=", "i", "+", "1", "\n", "copy", "(", "r", "[", "i", ":", "]", ",", "r", "[", "j", ":", "]", ")", "\n", "for", "k", ",", "n", ":=", "len", "(", "r", ")", "-", "j", "+", "i", ",", "len", "(", "r", ")", ";", "k", "<", "n", ";", "k", "++", "{", "r", "[", "k", "]", "=", "nil", "// free up the end of the list", "\n", "}", "// for k", "\n", "s", ".", "refs", "=", "r", "[", ":", "len", "(", "r", ")", "-", "j", "+", "i", "]", "\n", "break", "\n", "}", "\n", "}", "\n", "}" ]
// removeRef removes a shape reference from the list of references this // shape is used in.
[ "removeRef", "removes", "a", "shape", "reference", "from", "the", "list", "of", "references", "this", "shape", "is", "used", "in", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L837-L850
train
aws/aws-sdk-go
private/model/api/shape.go
Clone
func (s *Shape) Clone(newName string) *Shape { if s.AliasedShapeName { panic(fmt.Sprintf("attempted to clone and rename %s, but flagged as aliased", s.ShapeName)) } n := new(Shape) *n = *s debugLogger.Logln("cloning", s.ShapeName, "to", newName) n.MemberRefs = map[string]*ShapeRef{} for k, r := range s.MemberRefs { nr := new(ShapeRef) *nr = *r nr.Shape.refs = append(nr.Shape.refs, nr) n.MemberRefs[k] = nr } if n.MemberRef.Shape != nil { n.MemberRef.Shape.refs = append(n.MemberRef.Shape.refs, &n.MemberRef) } if n.KeyRef.Shape != nil { n.KeyRef.Shape.refs = append(n.KeyRef.Shape.refs, &n.KeyRef) } if n.ValueRef.Shape != nil { n.ValueRef.Shape.refs = append(n.ValueRef.Shape.refs, &n.ValueRef) } n.refs = []*ShapeRef{} n.Required = append([]string{}, n.Required...) n.Enum = append([]string{}, n.Enum...) n.EnumConsts = append([]string{}, n.EnumConsts...) n.OrigShapeName = n.ShapeName n.API.Shapes[newName] = n n.ShapeName = newName return n }
go
func (s *Shape) Clone(newName string) *Shape { if s.AliasedShapeName { panic(fmt.Sprintf("attempted to clone and rename %s, but flagged as aliased", s.ShapeName)) } n := new(Shape) *n = *s debugLogger.Logln("cloning", s.ShapeName, "to", newName) n.MemberRefs = map[string]*ShapeRef{} for k, r := range s.MemberRefs { nr := new(ShapeRef) *nr = *r nr.Shape.refs = append(nr.Shape.refs, nr) n.MemberRefs[k] = nr } if n.MemberRef.Shape != nil { n.MemberRef.Shape.refs = append(n.MemberRef.Shape.refs, &n.MemberRef) } if n.KeyRef.Shape != nil { n.KeyRef.Shape.refs = append(n.KeyRef.Shape.refs, &n.KeyRef) } if n.ValueRef.Shape != nil { n.ValueRef.Shape.refs = append(n.ValueRef.Shape.refs, &n.ValueRef) } n.refs = []*ShapeRef{} n.Required = append([]string{}, n.Required...) n.Enum = append([]string{}, n.Enum...) n.EnumConsts = append([]string{}, n.EnumConsts...) n.OrigShapeName = n.ShapeName n.API.Shapes[newName] = n n.ShapeName = newName return n }
[ "func", "(", "s", "*", "Shape", ")", "Clone", "(", "newName", "string", ")", "*", "Shape", "{", "if", "s", ".", "AliasedShapeName", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "s", ".", "ShapeName", ")", ")", "\n", "}", "\n\n", "n", ":=", "new", "(", "Shape", ")", "\n", "*", "n", "=", "*", "s", "\n\n", "debugLogger", ".", "Logln", "(", "\"", "\"", ",", "s", ".", "ShapeName", ",", "\"", "\"", ",", "newName", ")", "\n\n", "n", ".", "MemberRefs", "=", "map", "[", "string", "]", "*", "ShapeRef", "{", "}", "\n", "for", "k", ",", "r", ":=", "range", "s", ".", "MemberRefs", "{", "nr", ":=", "new", "(", "ShapeRef", ")", "\n", "*", "nr", "=", "*", "r", "\n", "nr", ".", "Shape", ".", "refs", "=", "append", "(", "nr", ".", "Shape", ".", "refs", ",", "nr", ")", "\n", "n", ".", "MemberRefs", "[", "k", "]", "=", "nr", "\n", "}", "\n\n", "if", "n", ".", "MemberRef", ".", "Shape", "!=", "nil", "{", "n", ".", "MemberRef", ".", "Shape", ".", "refs", "=", "append", "(", "n", ".", "MemberRef", ".", "Shape", ".", "refs", ",", "&", "n", ".", "MemberRef", ")", "\n", "}", "\n", "if", "n", ".", "KeyRef", ".", "Shape", "!=", "nil", "{", "n", ".", "KeyRef", ".", "Shape", ".", "refs", "=", "append", "(", "n", ".", "KeyRef", ".", "Shape", ".", "refs", ",", "&", "n", ".", "KeyRef", ")", "\n", "}", "\n", "if", "n", ".", "ValueRef", ".", "Shape", "!=", "nil", "{", "n", ".", "ValueRef", ".", "Shape", ".", "refs", "=", "append", "(", "n", ".", "ValueRef", ".", "Shape", ".", "refs", ",", "&", "n", ".", "ValueRef", ")", "\n", "}", "\n\n", "n", ".", "refs", "=", "[", "]", "*", "ShapeRef", "{", "}", "\n\n", "n", ".", "Required", "=", "append", "(", "[", "]", "string", "{", "}", ",", "n", ".", "Required", "...", ")", "\n", "n", ".", "Enum", "=", "append", "(", "[", "]", "string", "{", "}", ",", "n", ".", "Enum", "...", ")", "\n", "n", ".", "EnumConsts", "=", "append", "(", "[", "]", "string", "{", "}", ",", "n", ".", "EnumConsts", "...", ")", "\n\n", "n", ".", "OrigShapeName", "=", "n", ".", "ShapeName", "\n", "n", ".", "API", ".", "Shapes", "[", "newName", "]", "=", "n", "\n", "n", ".", "ShapeName", "=", "newName", "\n\n", "return", "n", "\n", "}" ]
// Clone returns a cloned version of the shape with all references clones. // // Does not clone EventStream or Validate related values.
[ "Clone", "returns", "a", "cloned", "version", "of", "the", "shape", "with", "all", "references", "clones", ".", "Does", "not", "clone", "EventStream", "or", "Validate", "related", "values", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/shape.go#L869-L909
train
aws/aws-sdk-go
service/cloudformation/api.go
SetResourceChange
func (s *Change) SetResourceChange(v *ResourceChange) *Change { s.ResourceChange = v return s }
go
func (s *Change) SetResourceChange(v *ResourceChange) *Change { s.ResourceChange = v return s }
[ "func", "(", "s", "*", "Change", ")", "SetResourceChange", "(", "v", "*", "ResourceChange", ")", "*", "Change", "{", "s", ".", "ResourceChange", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetResourceChange sets the ResourceChange field's value.
[ "SetResourceChange", "sets", "the", "ResourceChange", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L4458-L4461
train
aws/aws-sdk-go
service/cloudformation/api.go
SetResourcesToSkip
func (s *ContinueUpdateRollbackInput) SetResourcesToSkip(v []*string) *ContinueUpdateRollbackInput { s.ResourcesToSkip = v return s }
go
func (s *ContinueUpdateRollbackInput) SetResourcesToSkip(v []*string) *ContinueUpdateRollbackInput { s.ResourcesToSkip = v return s }
[ "func", "(", "s", "*", "ContinueUpdateRollbackInput", ")", "SetResourcesToSkip", "(", "v", "[", "]", "*", "string", ")", "*", "ContinueUpdateRollbackInput", "{", "s", ".", "ResourcesToSkip", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetResourcesToSkip sets the ResourcesToSkip field's value.
[ "SetResourcesToSkip", "sets", "the", "ResourcesToSkip", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L4681-L4684
train
aws/aws-sdk-go
service/cloudformation/api.go
SetChangeSetType
func (s *CreateChangeSetInput) SetChangeSetType(v string) *CreateChangeSetInput { s.ChangeSetType = &v return s }
go
func (s *CreateChangeSetInput) SetChangeSetType(v string) *CreateChangeSetInput { s.ChangeSetType = &v return s }
[ "func", "(", "s", "*", "CreateChangeSetInput", ")", "SetChangeSetType", "(", "v", "string", ")", "*", "CreateChangeSetInput", "{", "s", ".", "ChangeSetType", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetChangeSetType sets the ChangeSetType field's value.
[ "SetChangeSetType", "sets", "the", "ChangeSetType", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L4963-L4966
train
aws/aws-sdk-go
service/cloudformation/api.go
SetRetainResources
func (s *DeleteStackInput) SetRetainResources(v []*string) *DeleteStackInput { s.RetainResources = v return s }
go
func (s *DeleteStackInput) SetRetainResources(v []*string) *DeleteStackInput { s.RetainResources = v return s }
[ "func", "(", "s", "*", "DeleteStackInput", ")", "SetRetainResources", "(", "v", "[", "]", "*", "string", ")", "*", "DeleteStackInput", "{", "s", ".", "RetainResources", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetRetainResources sets the RetainResources field's value.
[ "SetRetainResources", "sets", "the", "RetainResources", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L6054-L6057
train
aws/aws-sdk-go
service/cloudformation/api.go
SetAccountLimits
func (s *DescribeAccountLimitsOutput) SetAccountLimits(v []*AccountLimit) *DescribeAccountLimitsOutput { s.AccountLimits = v return s }
go
func (s *DescribeAccountLimitsOutput) SetAccountLimits(v []*AccountLimit) *DescribeAccountLimitsOutput { s.AccountLimits = v return s }
[ "func", "(", "s", "*", "DescribeAccountLimitsOutput", ")", "SetAccountLimits", "(", "v", "[", "]", "*", "AccountLimit", ")", "*", "DescribeAccountLimitsOutput", "{", "s", ".", "AccountLimits", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetAccountLimits sets the AccountLimits field's value.
[ "SetAccountLimits", "sets", "the", "AccountLimits", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L6343-L6346
train
aws/aws-sdk-go
service/cloudformation/api.go
SetDetectionStatus
func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatus(v string) *DescribeStackDriftDetectionStatusOutput { s.DetectionStatus = &v return s }
go
func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatus(v string) *DescribeStackDriftDetectionStatusOutput { s.DetectionStatus = &v return s }
[ "func", "(", "s", "*", "DescribeStackDriftDetectionStatusOutput", ")", "SetDetectionStatus", "(", "v", "string", ")", "*", "DescribeStackDriftDetectionStatusOutput", "{", "s", ".", "DetectionStatus", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetDetectionStatus sets the DetectionStatus field's value.
[ "SetDetectionStatus", "sets", "the", "DetectionStatus", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L6719-L6722
train
aws/aws-sdk-go
service/cloudformation/api.go
SetDetectionStatusReason
func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatusReason(v string) *DescribeStackDriftDetectionStatusOutput { s.DetectionStatusReason = &v return s }
go
func (s *DescribeStackDriftDetectionStatusOutput) SetDetectionStatusReason(v string) *DescribeStackDriftDetectionStatusOutput { s.DetectionStatusReason = &v return s }
[ "func", "(", "s", "*", "DescribeStackDriftDetectionStatusOutput", ")", "SetDetectionStatusReason", "(", "v", "string", ")", "*", "DescribeStackDriftDetectionStatusOutput", "{", "s", ".", "DetectionStatusReason", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetDetectionStatusReason sets the DetectionStatusReason field's value.
[ "SetDetectionStatusReason", "sets", "the", "DetectionStatusReason", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L6725-L6728
train
aws/aws-sdk-go
service/cloudformation/api.go
SetDriftedStackResourceCount
func (s *DescribeStackDriftDetectionStatusOutput) SetDriftedStackResourceCount(v int64) *DescribeStackDriftDetectionStatusOutput { s.DriftedStackResourceCount = &v return s }
go
func (s *DescribeStackDriftDetectionStatusOutput) SetDriftedStackResourceCount(v int64) *DescribeStackDriftDetectionStatusOutput { s.DriftedStackResourceCount = &v return s }
[ "func", "(", "s", "*", "DescribeStackDriftDetectionStatusOutput", ")", "SetDriftedStackResourceCount", "(", "v", "int64", ")", "*", "DescribeStackDriftDetectionStatusOutput", "{", "s", ".", "DriftedStackResourceCount", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetDriftedStackResourceCount sets the DriftedStackResourceCount field's value.
[ "SetDriftedStackResourceCount", "sets", "the", "DriftedStackResourceCount", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L6731-L6734
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackEvents
func (s *DescribeStackEventsOutput) SetStackEvents(v []*StackEvent) *DescribeStackEventsOutput { s.StackEvents = v return s }
go
func (s *DescribeStackEventsOutput) SetStackEvents(v []*StackEvent) *DescribeStackEventsOutput { s.StackEvents = v return s }
[ "func", "(", "s", "*", "DescribeStackEventsOutput", ")", "SetStackEvents", "(", "v", "[", "]", "*", "StackEvent", ")", "*", "DescribeStackEventsOutput", "{", "s", ".", "StackEvents", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackEvents sets the StackEvents field's value.
[ "SetStackEvents", "sets", "the", "StackEvents", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L6843-L6846
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackInstance
func (s *DescribeStackInstanceOutput) SetStackInstance(v *StackInstance) *DescribeStackInstanceOutput { s.StackInstance = v return s }
go
func (s *DescribeStackInstanceOutput) SetStackInstance(v *StackInstance) *DescribeStackInstanceOutput { s.StackInstance = v return s }
[ "func", "(", "s", "*", "DescribeStackInstanceOutput", ")", "SetStackInstance", "(", "v", "*", "StackInstance", ")", "*", "DescribeStackInstanceOutput", "{", "s", ".", "StackInstance", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackInstance sets the StackInstance field's value.
[ "SetStackInstance", "sets", "the", "StackInstance", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L6933-L6936
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackResourceDriftStatusFilters
func (s *DescribeStackResourceDriftsInput) SetStackResourceDriftStatusFilters(v []*string) *DescribeStackResourceDriftsInput { s.StackResourceDriftStatusFilters = v return s }
go
func (s *DescribeStackResourceDriftsInput) SetStackResourceDriftStatusFilters(v []*string) *DescribeStackResourceDriftsInput { s.StackResourceDriftStatusFilters = v return s }
[ "func", "(", "s", "*", "DescribeStackResourceDriftsInput", ")", "SetStackResourceDriftStatusFilters", "(", "v", "[", "]", "*", "string", ")", "*", "DescribeStackResourceDriftsInput", "{", "s", ".", "StackResourceDriftStatusFilters", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackResourceDriftStatusFilters sets the StackResourceDriftStatusFilters field's value.
[ "SetStackResourceDriftStatusFilters", "sets", "the", "StackResourceDriftStatusFilters", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7025-L7028
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackResourceDrifts
func (s *DescribeStackResourceDriftsOutput) SetStackResourceDrifts(v []*StackResourceDrift) *DescribeStackResourceDriftsOutput { s.StackResourceDrifts = v return s }
go
func (s *DescribeStackResourceDriftsOutput) SetStackResourceDrifts(v []*StackResourceDrift) *DescribeStackResourceDriftsOutput { s.StackResourceDrifts = v return s }
[ "func", "(", "s", "*", "DescribeStackResourceDriftsOutput", ")", "SetStackResourceDrifts", "(", "v", "[", "]", "*", "StackResourceDrift", ")", "*", "DescribeStackResourceDriftsOutput", "{", "s", ".", "StackResourceDrifts", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackResourceDrifts sets the StackResourceDrifts field's value.
[ "SetStackResourceDrifts", "sets", "the", "StackResourceDrifts", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7070-L7073
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackResourceDetail
func (s *DescribeStackResourceOutput) SetStackResourceDetail(v *StackResourceDetail) *DescribeStackResourceOutput { s.StackResourceDetail = v return s }
go
func (s *DescribeStackResourceOutput) SetStackResourceDetail(v *StackResourceDetail) *DescribeStackResourceOutput { s.StackResourceDetail = v return s }
[ "func", "(", "s", "*", "DescribeStackResourceOutput", ")", "SetStackResourceDetail", "(", "v", "*", "StackResourceDetail", ")", "*", "DescribeStackResourceOutput", "{", "s", ".", "StackResourceDetail", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackResourceDetail sets the StackResourceDetail field's value.
[ "SetStackResourceDetail", "sets", "the", "StackResourceDetail", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7158-L7161
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackResources
func (s *DescribeStackResourcesOutput) SetStackResources(v []*StackResource) *DescribeStackResourcesOutput { s.StackResources = v return s }
go
func (s *DescribeStackResourcesOutput) SetStackResources(v []*StackResource) *DescribeStackResourcesOutput { s.StackResources = v return s }
[ "func", "(", "s", "*", "DescribeStackResourcesOutput", ")", "SetStackResources", "(", "v", "[", "]", "*", "StackResource", ")", "*", "DescribeStackResourcesOutput", "{", "s", ".", "StackResources", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackResources sets the StackResources field's value.
[ "SetStackResources", "sets", "the", "StackResources", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7248-L7251
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackSetOperation
func (s *DescribeStackSetOperationOutput) SetStackSetOperation(v *StackSetOperation) *DescribeStackSetOperationOutput { s.StackSetOperation = v return s }
go
func (s *DescribeStackSetOperationOutput) SetStackSetOperation(v *StackSetOperation) *DescribeStackSetOperationOutput { s.StackSetOperation = v return s }
[ "func", "(", "s", "*", "DescribeStackSetOperationOutput", ")", "SetStackSetOperation", "(", "v", "*", "StackSetOperation", ")", "*", "DescribeStackSetOperationOutput", "{", "s", ".", "StackSetOperation", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackSetOperation sets the StackSetOperation field's value.
[ "SetStackSetOperation", "sets", "the", "StackSetOperation", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7364-L7367
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackSet
func (s *DescribeStackSetOutput) SetStackSet(v *StackSet) *DescribeStackSetOutput { s.StackSet = v return s }
go
func (s *DescribeStackSetOutput) SetStackSet(v *StackSet) *DescribeStackSetOutput { s.StackSet = v return s }
[ "func", "(", "s", "*", "DescribeStackSetOutput", ")", "SetStackSet", "(", "v", "*", "StackSet", ")", "*", "DescribeStackSetOutput", "{", "s", ".", "StackSet", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackSet sets the StackSet field's value.
[ "SetStackSet", "sets", "the", "StackSet", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7387-L7390
train
aws/aws-sdk-go
service/cloudformation/api.go
SetLogicalResourceIds
func (s *DetectStackDriftInput) SetLogicalResourceIds(v []*string) *DetectStackDriftInput { s.LogicalResourceIds = v return s }
go
func (s *DetectStackDriftInput) SetLogicalResourceIds(v []*string) *DetectStackDriftInput { s.LogicalResourceIds = v return s }
[ "func", "(", "s", "*", "DetectStackDriftInput", ")", "SetLogicalResourceIds", "(", "v", "[", "]", "*", "string", ")", "*", "DetectStackDriftInput", "{", "s", ".", "LogicalResourceIds", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetLogicalResourceIds sets the LogicalResourceIds field's value.
[ "SetLogicalResourceIds", "sets", "the", "LogicalResourceIds", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7522-L7525
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackResourceDrift
func (s *DetectStackResourceDriftOutput) SetStackResourceDrift(v *StackResourceDrift) *DetectStackResourceDriftOutput { s.StackResourceDrift = v return s }
go
func (s *DetectStackResourceDriftOutput) SetStackResourceDrift(v *StackResourceDrift) *DetectStackResourceDriftOutput { s.StackResourceDrift = v return s }
[ "func", "(", "s", "*", "DetectStackResourceDriftOutput", ")", "SetStackResourceDrift", "(", "v", "*", "StackResourceDrift", ")", "*", "DetectStackResourceDriftOutput", "{", "s", ".", "StackResourceDrift", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackResourceDrift sets the StackResourceDrift field's value.
[ "SetStackResourceDrift", "sets", "the", "StackResourceDrift", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7639-L7642
train
aws/aws-sdk-go
service/cloudformation/api.go
SetExportingStackId
func (s *Export) SetExportingStackId(v string) *Export { s.ExportingStackId = &v return s }
go
func (s *Export) SetExportingStackId(v string) *Export { s.ExportingStackId = &v return s }
[ "func", "(", "s", "*", "Export", ")", "SetExportingStackId", "(", "v", "string", ")", "*", "Export", "{", "s", ".", "ExportingStackId", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetExportingStackId sets the ExportingStackId field's value.
[ "SetExportingStackId", "sets", "the", "ExportingStackId", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L7854-L7857
train
aws/aws-sdk-go
service/cloudformation/api.go
SetTemplateStage
func (s *GetTemplateInput) SetTemplateStage(v string) *GetTemplateInput { s.TemplateStage = &v return s }
go
func (s *GetTemplateInput) SetTemplateStage(v string) *GetTemplateInput { s.TemplateStage = &v return s }
[ "func", "(", "s", "*", "GetTemplateInput", ")", "SetTemplateStage", "(", "v", "string", ")", "*", "GetTemplateInput", "{", "s", ".", "TemplateStage", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetTemplateStage sets the TemplateStage field's value.
[ "SetTemplateStage", "sets", "the", "TemplateStage", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L8003-L8006
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStagesAvailable
func (s *GetTemplateOutput) SetStagesAvailable(v []*string) *GetTemplateOutput { s.StagesAvailable = v return s }
go
func (s *GetTemplateOutput) SetStagesAvailable(v []*string) *GetTemplateOutput { s.StagesAvailable = v return s }
[ "func", "(", "s", "*", "GetTemplateOutput", ")", "SetStagesAvailable", "(", "v", "[", "]", "*", "string", ")", "*", "GetTemplateOutput", "{", "s", ".", "StagesAvailable", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStagesAvailable sets the StagesAvailable field's value.
[ "SetStagesAvailable", "sets", "the", "StagesAvailable", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L8038-L8041
train
aws/aws-sdk-go
service/cloudformation/api.go
SetExports
func (s *ListExportsOutput) SetExports(v []*Export) *ListExportsOutput { s.Exports = v return s }
go
func (s *ListExportsOutput) SetExports(v []*Export) *ListExportsOutput { s.Exports = v return s }
[ "func", "(", "s", "*", "ListExportsOutput", ")", "SetExports", "(", "v", "[", "]", "*", "Export", ")", "*", "ListExportsOutput", "{", "s", ".", "Exports", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetExports sets the Exports field's value.
[ "SetExports", "sets", "the", "Exports", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L8388-L8391
train
aws/aws-sdk-go
service/cloudformation/api.go
SetImports
func (s *ListImportsOutput) SetImports(v []*string) *ListImportsOutput { s.Imports = v return s }
go
func (s *ListImportsOutput) SetImports(v []*string) *ListImportsOutput { s.Imports = v return s }
[ "func", "(", "s", "*", "ListImportsOutput", ")", "SetImports", "(", "v", "[", "]", "*", "string", ")", "*", "ListImportsOutput", "{", "s", ".", "Imports", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetImports sets the Imports field's value.
[ "SetImports", "sets", "the", "Imports", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L8473-L8476
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackResourceSummaries
func (s *ListStackResourcesOutput) SetStackResourceSummaries(v []*StackResourceSummary) *ListStackResourcesOutput { s.StackResourceSummaries = v return s }
go
func (s *ListStackResourcesOutput) SetStackResourceSummaries(v []*StackResourceSummary) *ListStackResourcesOutput { s.StackResourceSummaries = v return s }
[ "func", "(", "s", "*", "ListStackResourcesOutput", ")", "SetStackResourceSummaries", "(", "v", "[", "]", "*", "StackResourceSummary", ")", "*", "ListStackResourcesOutput", "{", "s", ".", "StackResourceSummaries", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackResourceSummaries sets the StackResourceSummaries field's value.
[ "SetStackResourceSummaries", "sets", "the", "StackResourceSummaries", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L8697-L8700
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackStatusFilter
func (s *ListStacksInput) SetStackStatusFilter(v []*string) *ListStacksInput { s.StackStatusFilter = v return s }
go
func (s *ListStacksInput) SetStackStatusFilter(v []*string) *ListStacksInput { s.StackStatusFilter = v return s }
[ "func", "(", "s", "*", "ListStacksInput", ")", "SetStackStatusFilter", "(", "v", "[", "]", "*", "string", ")", "*", "ListStacksInput", "{", "s", ".", "StackStatusFilter", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackStatusFilter sets the StackStatusFilter field's value.
[ "SetStackStatusFilter", "sets", "the", "StackStatusFilter", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L9075-L9078
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackSummaries
func (s *ListStacksOutput) SetStackSummaries(v []*StackSummary) *ListStacksOutput { s.StackSummaries = v return s }
go
func (s *ListStacksOutput) SetStackSummaries(v []*StackSummary) *ListStacksOutput { s.StackSummaries = v return s }
[ "func", "(", "s", "*", "ListStacksOutput", ")", "SetStackSummaries", "(", "v", "[", "]", "*", "StackSummary", ")", "*", "ListStacksOutput", "{", "s", ".", "StackSummaries", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetStackSummaries sets the StackSummaries field's value.
[ "SetStackSummaries", "sets", "the", "StackSummaries", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L9110-L9113
train
aws/aws-sdk-go
service/cloudformation/api.go
SetResolvedValue
func (s *Parameter) SetResolvedValue(v string) *Parameter { s.ResolvedValue = &v return s }
go
func (s *Parameter) SetResolvedValue(v string) *Parameter { s.ResolvedValue = &v return s }
[ "func", "(", "s", "*", "Parameter", ")", "SetResolvedValue", "(", "v", "string", ")", "*", "Parameter", "{", "s", ".", "ResolvedValue", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetResolvedValue sets the ResolvedValue field's value.
[ "SetResolvedValue", "sets", "the", "ResolvedValue", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L9212-L9215
train
aws/aws-sdk-go
service/cloudformation/api.go
SetActualValue
func (s *PropertyDifference) SetActualValue(v string) *PropertyDifference { s.ActualValue = &v return s }
go
func (s *PropertyDifference) SetActualValue(v string) *PropertyDifference { s.ActualValue = &v return s }
[ "func", "(", "s", "*", "PropertyDifference", ")", "SetActualValue", "(", "v", "string", ")", "*", "PropertyDifference", "{", "s", ".", "ActualValue", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetActualValue sets the ActualValue field's value.
[ "SetActualValue", "sets", "the", "ActualValue", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L9410-L9413
train
aws/aws-sdk-go
service/cloudformation/api.go
SetDifferenceType
func (s *PropertyDifference) SetDifferenceType(v string) *PropertyDifference { s.DifferenceType = &v return s }
go
func (s *PropertyDifference) SetDifferenceType(v string) *PropertyDifference { s.DifferenceType = &v return s }
[ "func", "(", "s", "*", "PropertyDifference", ")", "SetDifferenceType", "(", "v", "string", ")", "*", "PropertyDifference", "{", "s", ".", "DifferenceType", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetDifferenceType sets the DifferenceType field's value.
[ "SetDifferenceType", "sets", "the", "DifferenceType", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L9416-L9419
train
aws/aws-sdk-go
service/cloudformation/api.go
SetExpectedValue
func (s *PropertyDifference) SetExpectedValue(v string) *PropertyDifference { s.ExpectedValue = &v return s }
go
func (s *PropertyDifference) SetExpectedValue(v string) *PropertyDifference { s.ExpectedValue = &v return s }
[ "func", "(", "s", "*", "PropertyDifference", ")", "SetExpectedValue", "(", "v", "string", ")", "*", "PropertyDifference", "{", "s", ".", "ExpectedValue", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetExpectedValue sets the ExpectedValue field's value.
[ "SetExpectedValue", "sets", "the", "ExpectedValue", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L9422-L9425
train
aws/aws-sdk-go
service/cloudformation/api.go
SetPropertyPath
func (s *PropertyDifference) SetPropertyPath(v string) *PropertyDifference { s.PropertyPath = &v return s }
go
func (s *PropertyDifference) SetPropertyPath(v string) *PropertyDifference { s.PropertyPath = &v return s }
[ "func", "(", "s", "*", "PropertyDifference", ")", "SetPropertyPath", "(", "v", "string", ")", "*", "PropertyDifference", "{", "s", ".", "PropertyPath", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetPropertyPath sets the PropertyPath field's value.
[ "SetPropertyPath", "sets", "the", "PropertyPath", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L9428-L9431
train
aws/aws-sdk-go
service/cloudformation/api.go
SetChangeSource
func (s *ResourceChangeDetail) SetChangeSource(v string) *ResourceChangeDetail { s.ChangeSource = &v return s }
go
func (s *ResourceChangeDetail) SetChangeSource(v string) *ResourceChangeDetail { s.ChangeSource = &v return s }
[ "func", "(", "s", "*", "ResourceChangeDetail", ")", "SetChangeSource", "(", "v", "string", ")", "*", "ResourceChangeDetail", "{", "s", ".", "ChangeSource", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetChangeSource sets the ChangeSource field's value.
[ "SetChangeSource", "sets", "the", "ChangeSource", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L9603-L9606
train
aws/aws-sdk-go
service/cloudformation/api.go
SetResourceProperties
func (s *StackEvent) SetResourceProperties(v string) *StackEvent { s.ResourceProperties = &v return s }
go
func (s *StackEvent) SetResourceProperties(v string) *StackEvent { s.ResourceProperties = &v return s }
[ "func", "(", "s", "*", "StackEvent", ")", "SetResourceProperties", "(", "v", "string", ")", "*", "StackEvent", "{", "s", ".", "ResourceProperties", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetResourceProperties sets the ResourceProperties field's value.
[ "SetResourceProperties", "sets", "the", "ResourceProperties", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L10462-L10465
train
aws/aws-sdk-go
service/cloudformation/api.go
SetActualProperties
func (s *StackResourceDrift) SetActualProperties(v string) *StackResourceDrift { s.ActualProperties = &v return s }
go
func (s *StackResourceDrift) SetActualProperties(v string) *StackResourceDrift { s.ActualProperties = &v return s }
[ "func", "(", "s", "*", "StackResourceDrift", ")", "SetActualProperties", "(", "v", "string", ")", "*", "StackResourceDrift", "{", "s", ".", "ActualProperties", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetActualProperties sets the ActualProperties field's value.
[ "SetActualProperties", "sets", "the", "ActualProperties", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11037-L11040
train
aws/aws-sdk-go
service/cloudformation/api.go
SetExpectedProperties
func (s *StackResourceDrift) SetExpectedProperties(v string) *StackResourceDrift { s.ExpectedProperties = &v return s }
go
func (s *StackResourceDrift) SetExpectedProperties(v string) *StackResourceDrift { s.ExpectedProperties = &v return s }
[ "func", "(", "s", "*", "StackResourceDrift", ")", "SetExpectedProperties", "(", "v", "string", ")", "*", "StackResourceDrift", "{", "s", ".", "ExpectedProperties", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetExpectedProperties sets the ExpectedProperties field's value.
[ "SetExpectedProperties", "sets", "the", "ExpectedProperties", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11043-L11046
train
aws/aws-sdk-go
service/cloudformation/api.go
SetPhysicalResourceIdContext
func (s *StackResourceDrift) SetPhysicalResourceIdContext(v []*PhysicalResourceIdContextKeyValuePair) *StackResourceDrift { s.PhysicalResourceIdContext = v return s }
go
func (s *StackResourceDrift) SetPhysicalResourceIdContext(v []*PhysicalResourceIdContextKeyValuePair) *StackResourceDrift { s.PhysicalResourceIdContext = v return s }
[ "func", "(", "s", "*", "StackResourceDrift", ")", "SetPhysicalResourceIdContext", "(", "v", "[", "]", "*", "PhysicalResourceIdContextKeyValuePair", ")", "*", "StackResourceDrift", "{", "s", ".", "PhysicalResourceIdContext", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetPhysicalResourceIdContext sets the PhysicalResourceIdContext field's value.
[ "SetPhysicalResourceIdContext", "sets", "the", "PhysicalResourceIdContext", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11061-L11064
train
aws/aws-sdk-go
service/cloudformation/api.go
SetPropertyDifferences
func (s *StackResourceDrift) SetPropertyDifferences(v []*PropertyDifference) *StackResourceDrift { s.PropertyDifferences = v return s }
go
func (s *StackResourceDrift) SetPropertyDifferences(v []*PropertyDifference) *StackResourceDrift { s.PropertyDifferences = v return s }
[ "func", "(", "s", "*", "StackResourceDrift", ")", "SetPropertyDifferences", "(", "v", "[", "]", "*", "PropertyDifference", ")", "*", "StackResourceDrift", "{", "s", ".", "PropertyDifferences", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetPropertyDifferences sets the PropertyDifferences field's value.
[ "SetPropertyDifferences", "sets", "the", "PropertyDifferences", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11067-L11070
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackSetARN
func (s *StackSet) SetStackSetARN(v string) *StackSet { s.StackSetARN = &v return s }
go
func (s *StackSet) SetStackSetARN(v string) *StackSet { s.StackSetARN = &v return s }
[ "func", "(", "s", "*", "StackSet", ")", "SetStackSetARN", "(", "v", "string", ")", "*", "StackSet", "{", "s", ".", "StackSetARN", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetStackSetARN sets the StackSetARN field's value.
[ "SetStackSetARN", "sets", "the", "StackSetARN", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11394-L11397
train
aws/aws-sdk-go
service/cloudformation/api.go
SetFailureToleranceCount
func (s *StackSetOperationPreferences) SetFailureToleranceCount(v int64) *StackSetOperationPreferences { s.FailureToleranceCount = &v return s }
go
func (s *StackSetOperationPreferences) SetFailureToleranceCount(v int64) *StackSetOperationPreferences { s.FailureToleranceCount = &v return s }
[ "func", "(", "s", "*", "StackSetOperationPreferences", ")", "SetFailureToleranceCount", "(", "v", "int64", ")", "*", "StackSetOperationPreferences", "{", "s", ".", "FailureToleranceCount", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetFailureToleranceCount sets the FailureToleranceCount field's value.
[ "SetFailureToleranceCount", "sets", "the", "FailureToleranceCount", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11661-L11664
train
aws/aws-sdk-go
service/cloudformation/api.go
SetFailureTolerancePercentage
func (s *StackSetOperationPreferences) SetFailureTolerancePercentage(v int64) *StackSetOperationPreferences { s.FailureTolerancePercentage = &v return s }
go
func (s *StackSetOperationPreferences) SetFailureTolerancePercentage(v int64) *StackSetOperationPreferences { s.FailureTolerancePercentage = &v return s }
[ "func", "(", "s", "*", "StackSetOperationPreferences", ")", "SetFailureTolerancePercentage", "(", "v", "int64", ")", "*", "StackSetOperationPreferences", "{", "s", ".", "FailureTolerancePercentage", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetFailureTolerancePercentage sets the FailureTolerancePercentage field's value.
[ "SetFailureTolerancePercentage", "sets", "the", "FailureTolerancePercentage", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11667-L11670
train
aws/aws-sdk-go
service/cloudformation/api.go
SetMaxConcurrentCount
func (s *StackSetOperationPreferences) SetMaxConcurrentCount(v int64) *StackSetOperationPreferences { s.MaxConcurrentCount = &v return s }
go
func (s *StackSetOperationPreferences) SetMaxConcurrentCount(v int64) *StackSetOperationPreferences { s.MaxConcurrentCount = &v return s }
[ "func", "(", "s", "*", "StackSetOperationPreferences", ")", "SetMaxConcurrentCount", "(", "v", "int64", ")", "*", "StackSetOperationPreferences", "{", "s", ".", "MaxConcurrentCount", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetMaxConcurrentCount sets the MaxConcurrentCount field's value.
[ "SetMaxConcurrentCount", "sets", "the", "MaxConcurrentCount", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11673-L11676
train
aws/aws-sdk-go
service/cloudformation/api.go
SetMaxConcurrentPercentage
func (s *StackSetOperationPreferences) SetMaxConcurrentPercentage(v int64) *StackSetOperationPreferences { s.MaxConcurrentPercentage = &v return s }
go
func (s *StackSetOperationPreferences) SetMaxConcurrentPercentage(v int64) *StackSetOperationPreferences { s.MaxConcurrentPercentage = &v return s }
[ "func", "(", "s", "*", "StackSetOperationPreferences", ")", "SetMaxConcurrentPercentage", "(", "v", "int64", ")", "*", "StackSetOperationPreferences", "{", "s", ".", "MaxConcurrentPercentage", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetMaxConcurrentPercentage sets the MaxConcurrentPercentage field's value.
[ "SetMaxConcurrentPercentage", "sets", "the", "MaxConcurrentPercentage", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11679-L11682
train
aws/aws-sdk-go
service/cloudformation/api.go
SetRegionOrder
func (s *StackSetOperationPreferences) SetRegionOrder(v []*string) *StackSetOperationPreferences { s.RegionOrder = v return s }
go
func (s *StackSetOperationPreferences) SetRegionOrder(v []*string) *StackSetOperationPreferences { s.RegionOrder = v return s }
[ "func", "(", "s", "*", "StackSetOperationPreferences", ")", "SetRegionOrder", "(", "v", "[", "]", "*", "string", ")", "*", "StackSetOperationPreferences", "{", "s", ".", "RegionOrder", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetRegionOrder sets the RegionOrder field's value.
[ "SetRegionOrder", "sets", "the", "RegionOrder", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11685-L11688
train
aws/aws-sdk-go
service/cloudformation/api.go
SetAccountGateResult
func (s *StackSetOperationResultSummary) SetAccountGateResult(v *AccountGateResult) *StackSetOperationResultSummary { s.AccountGateResult = v return s }
go
func (s *StackSetOperationResultSummary) SetAccountGateResult(v *AccountGateResult) *StackSetOperationResultSummary { s.AccountGateResult = v return s }
[ "func", "(", "s", "*", "StackSetOperationResultSummary", ")", "SetAccountGateResult", "(", "v", "*", "AccountGateResult", ")", "*", "StackSetOperationResultSummary", "{", "s", ".", "AccountGateResult", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetAccountGateResult sets the AccountGateResult field's value.
[ "SetAccountGateResult", "sets", "the", "AccountGateResult", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L11749-L11752
train
aws/aws-sdk-go
service/cloudformation/api.go
SetTemplateDescription
func (s *StackSummary) SetTemplateDescription(v string) *StackSummary { s.TemplateDescription = &v return s }
go
func (s *StackSummary) SetTemplateDescription(v string) *StackSummary { s.TemplateDescription = &v return s }
[ "func", "(", "s", "*", "StackSummary", ")", "SetTemplateDescription", "(", "v", "string", ")", "*", "StackSummary", "{", "s", ".", "TemplateDescription", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetTemplateDescription sets the TemplateDescription field's value.
[ "SetTemplateDescription", "sets", "the", "TemplateDescription", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L12040-L12043
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackPolicyDuringUpdateBody
func (s *UpdateStackInput) SetStackPolicyDuringUpdateBody(v string) *UpdateStackInput { s.StackPolicyDuringUpdateBody = &v return s }
go
func (s *UpdateStackInput) SetStackPolicyDuringUpdateBody(v string) *UpdateStackInput { s.StackPolicyDuringUpdateBody = &v return s }
[ "func", "(", "s", "*", "UpdateStackInput", ")", "SetStackPolicyDuringUpdateBody", "(", "v", "string", ")", "*", "UpdateStackInput", "{", "s", ".", "StackPolicyDuringUpdateBody", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetStackPolicyDuringUpdateBody sets the StackPolicyDuringUpdateBody field's value.
[ "SetStackPolicyDuringUpdateBody", "sets", "the", "StackPolicyDuringUpdateBody", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L12553-L12556
train
aws/aws-sdk-go
service/cloudformation/api.go
SetStackPolicyDuringUpdateURL
func (s *UpdateStackInput) SetStackPolicyDuringUpdateURL(v string) *UpdateStackInput { s.StackPolicyDuringUpdateURL = &v return s }
go
func (s *UpdateStackInput) SetStackPolicyDuringUpdateURL(v string) *UpdateStackInput { s.StackPolicyDuringUpdateURL = &v return s }
[ "func", "(", "s", "*", "UpdateStackInput", ")", "SetStackPolicyDuringUpdateURL", "(", "v", "string", ")", "*", "UpdateStackInput", "{", "s", ".", "StackPolicyDuringUpdateURL", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetStackPolicyDuringUpdateURL sets the StackPolicyDuringUpdateURL field's value.
[ "SetStackPolicyDuringUpdateURL", "sets", "the", "StackPolicyDuringUpdateURL", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/cloudformation/api.go#L12559-L12562
train
aws/aws-sdk-go
private/model/api/docstring.go
AttachDocs
func (a *API) AttachDocs(filename string) { d := apiDocumentation{API: a} f, err := os.Open(filename) defer f.Close() if err != nil { panic(err) } err = json.NewDecoder(f).Decode(&d) if err != nil { panic(err) } d.setup() }
go
func (a *API) AttachDocs(filename string) { d := apiDocumentation{API: a} f, err := os.Open(filename) defer f.Close() if err != nil { panic(err) } err = json.NewDecoder(f).Decode(&d) if err != nil { panic(err) } d.setup() }
[ "func", "(", "a", "*", "API", ")", "AttachDocs", "(", "filename", "string", ")", "{", "d", ":=", "apiDocumentation", "{", "API", ":", "a", "}", "\n\n", "f", ",", "err", ":=", "os", ".", "Open", "(", "filename", ")", "\n", "defer", "f", ".", "Close", "(", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ")", "\n", "}", "\n", "err", "=", "json", ".", "NewDecoder", "(", "f", ")", ".", "Decode", "(", "&", "d", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ")", "\n", "}", "\n\n", "d", ".", "setup", "(", ")", "\n\n", "}" ]
// AttachDocs attaches documentation from a JSON filename.
[ "AttachDocs", "attaches", "documentation", "from", "a", "JSON", "filename", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/docstring.go#L30-L45
train
aws/aws-sdk-go
private/model/api/docstring.go
docstring
func docstring(doc string) string { doc = strings.TrimSpace(doc) if doc == "" { return "" } doc = reNewline.ReplaceAllString(doc, "") doc = reMultiSpace.ReplaceAllString(doc, " ") doc = reComments.ReplaceAllString(doc, "") var fullname string parts := reFullnameBlock.FindStringSubmatch(doc) if len(parts) > 1 { fullname = parts[1] } // Remove full name block from doc string doc = reFullname.ReplaceAllString(doc, "") doc = reExamples.ReplaceAllString(doc, "") doc = generateDoc(doc) doc = reEndNL.ReplaceAllString(doc, "") doc = html.UnescapeString(doc) // Replace doc with full name if doc is empty. doc = strings.TrimSpace(doc) if len(doc) == 0 { doc = fullname } return commentify(doc) }
go
func docstring(doc string) string { doc = strings.TrimSpace(doc) if doc == "" { return "" } doc = reNewline.ReplaceAllString(doc, "") doc = reMultiSpace.ReplaceAllString(doc, " ") doc = reComments.ReplaceAllString(doc, "") var fullname string parts := reFullnameBlock.FindStringSubmatch(doc) if len(parts) > 1 { fullname = parts[1] } // Remove full name block from doc string doc = reFullname.ReplaceAllString(doc, "") doc = reExamples.ReplaceAllString(doc, "") doc = generateDoc(doc) doc = reEndNL.ReplaceAllString(doc, "") doc = html.UnescapeString(doc) // Replace doc with full name if doc is empty. doc = strings.TrimSpace(doc) if len(doc) == 0 { doc = fullname } return commentify(doc) }
[ "func", "docstring", "(", "doc", "string", ")", "string", "{", "doc", "=", "strings", ".", "TrimSpace", "(", "doc", ")", "\n", "if", "doc", "==", "\"", "\"", "{", "return", "\"", "\"", "\n", "}", "\n\n", "doc", "=", "reNewline", ".", "ReplaceAllString", "(", "doc", ",", "\"", "\"", ")", "\n", "doc", "=", "reMultiSpace", ".", "ReplaceAllString", "(", "doc", ",", "\"", "\"", ")", "\n", "doc", "=", "reComments", ".", "ReplaceAllString", "(", "doc", ",", "\"", "\"", ")", "\n\n", "var", "fullname", "string", "\n", "parts", ":=", "reFullnameBlock", ".", "FindStringSubmatch", "(", "doc", ")", "\n", "if", "len", "(", "parts", ")", ">", "1", "{", "fullname", "=", "parts", "[", "1", "]", "\n", "}", "\n", "// Remove full name block from doc string", "doc", "=", "reFullname", ".", "ReplaceAllString", "(", "doc", ",", "\"", "\"", ")", "\n\n", "doc", "=", "reExamples", ".", "ReplaceAllString", "(", "doc", ",", "\"", "\"", ")", "\n", "doc", "=", "generateDoc", "(", "doc", ")", "\n", "doc", "=", "reEndNL", ".", "ReplaceAllString", "(", "doc", ",", "\"", "\"", ")", "\n", "doc", "=", "html", ".", "UnescapeString", "(", "doc", ")", "\n\n", "// Replace doc with full name if doc is empty.", "doc", "=", "strings", ".", "TrimSpace", "(", "doc", ")", "\n", "if", "len", "(", "doc", ")", "==", "0", "{", "doc", "=", "fullname", "\n", "}", "\n\n", "return", "commentify", "(", "doc", ")", "\n", "}" ]
// docstring rewrites a string to insert godocs formatting.
[ "docstring", "rewrites", "a", "string", "to", "insert", "godocs", "formatting", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/docstring.go#L92-L122
train
aws/aws-sdk-go
private/model/api/docstring.go
commentify
func commentify(doc string) string { if len(doc) == 0 { return "" } lines := strings.Split(doc, "\n") out := make([]string, 0, len(lines)) for i := 0; i < len(lines); i++ { line := lines[i] if i > 0 && line == "" && lines[i-1] == "" { continue } out = append(out, line) } if len(out) > 0 { out[0] = "// " + out[0] return strings.Join(out, "\n// ") } return "" }
go
func commentify(doc string) string { if len(doc) == 0 { return "" } lines := strings.Split(doc, "\n") out := make([]string, 0, len(lines)) for i := 0; i < len(lines); i++ { line := lines[i] if i > 0 && line == "" && lines[i-1] == "" { continue } out = append(out, line) } if len(out) > 0 { out[0] = "// " + out[0] return strings.Join(out, "\n// ") } return "" }
[ "func", "commentify", "(", "doc", "string", ")", "string", "{", "if", "len", "(", "doc", ")", "==", "0", "{", "return", "\"", "\"", "\n", "}", "\n\n", "lines", ":=", "strings", ".", "Split", "(", "doc", ",", "\"", "\\n", "\"", ")", "\n", "out", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "lines", ")", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "lines", ")", ";", "i", "++", "{", "line", ":=", "lines", "[", "i", "]", "\n\n", "if", "i", ">", "0", "&&", "line", "==", "\"", "\"", "&&", "lines", "[", "i", "-", "1", "]", "==", "\"", "\"", "{", "continue", "\n", "}", "\n", "out", "=", "append", "(", "out", ",", "line", ")", "\n", "}", "\n\n", "if", "len", "(", "out", ")", ">", "0", "{", "out", "[", "0", "]", "=", "\"", "\"", "+", "out", "[", "0", "]", "\n", "return", "strings", ".", "Join", "(", "out", ",", "\"", "\\n", "\"", ")", "\n", "}", "\n", "return", "\"", "\"", "\n", "}" ]
// commentify converts a string to a Go comment
[ "commentify", "converts", "a", "string", "to", "a", "Go", "comment" ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/docstring.go#L140-L161
train
aws/aws-sdk-go
private/model/api/docstring.go
wrap
func wrap(text string, length int, isIndented bool) string { var buf bytes.Buffer var last rune var lastNL bool var col int for _, c := range text { switch c { case '\r': // ignore this continue // and also don't track `last` case '\n': // ignore this too, but reset col if col >= length || last == '\n' { buf.WriteString("\n") } buf.WriteString("\n") col = 0 case ' ', '\t': // opportunity to split if col >= length { buf.WriteByte('\n') col = 0 if isIndented { buf.WriteString(indent) col += 3 } } else { // We only want to write a leading space if the col is greater than zero. // This will provide the proper spacing for documentation. buf.WriteRune(c) col++ // count column } default: buf.WriteRune(c) col++ } lastNL = c == '\n' _ = lastNL last = c } return buf.String() }
go
func wrap(text string, length int, isIndented bool) string { var buf bytes.Buffer var last rune var lastNL bool var col int for _, c := range text { switch c { case '\r': // ignore this continue // and also don't track `last` case '\n': // ignore this too, but reset col if col >= length || last == '\n' { buf.WriteString("\n") } buf.WriteString("\n") col = 0 case ' ', '\t': // opportunity to split if col >= length { buf.WriteByte('\n') col = 0 if isIndented { buf.WriteString(indent) col += 3 } } else { // We only want to write a leading space if the col is greater than zero. // This will provide the proper spacing for documentation. buf.WriteRune(c) col++ // count column } default: buf.WriteRune(c) col++ } lastNL = c == '\n' _ = lastNL last = c } return buf.String() }
[ "func", "wrap", "(", "text", "string", ",", "length", "int", ",", "isIndented", "bool", ")", "string", "{", "var", "buf", "bytes", ".", "Buffer", "\n", "var", "last", "rune", "\n", "var", "lastNL", "bool", "\n", "var", "col", "int", "\n\n", "for", "_", ",", "c", ":=", "range", "text", "{", "switch", "c", "{", "case", "'\\r'", ":", "// ignore this", "continue", "// and also don't track `last`", "\n", "case", "'\\n'", ":", "// ignore this too, but reset col", "if", "col", ">=", "length", "||", "last", "==", "'\\n'", "{", "buf", ".", "WriteString", "(", "\"", "\\n", "\"", ")", "\n", "}", "\n", "buf", ".", "WriteString", "(", "\"", "\\n", "\"", ")", "\n", "col", "=", "0", "\n", "case", "' '", ",", "'\\t'", ":", "// opportunity to split", "if", "col", ">=", "length", "{", "buf", ".", "WriteByte", "(", "'\\n'", ")", "\n", "col", "=", "0", "\n", "if", "isIndented", "{", "buf", ".", "WriteString", "(", "indent", ")", "\n", "col", "+=", "3", "\n", "}", "\n", "}", "else", "{", "// We only want to write a leading space if the col is greater than zero.", "// This will provide the proper spacing for documentation.", "buf", ".", "WriteRune", "(", "c", ")", "\n", "col", "++", "// count column", "\n", "}", "\n", "default", ":", "buf", ".", "WriteRune", "(", "c", ")", "\n", "col", "++", "\n", "}", "\n", "lastNL", "=", "c", "==", "'\\n'", "\n", "_", "=", "lastNL", "\n", "last", "=", "c", "\n", "}", "\n", "return", "buf", ".", "String", "(", ")", "\n", "}" ]
// wrap returns a rewritten version of text to have line breaks // at approximately length characters. Line breaks will only be // inserted into whitespace.
[ "wrap", "returns", "a", "rewritten", "version", "of", "text", "to", "have", "line", "breaks", "at", "approximately", "length", "characters", ".", "Line", "breaks", "will", "only", "be", "inserted", "into", "whitespace", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/docstring.go#L166-L205
train
aws/aws-sdk-go
private/model/api/docstring.go
generateDoc
func generateDoc(htmlSrc string) string { tokenizer := xhtml.NewTokenizer(strings.NewReader(htmlSrc)) tokens := buildTokenArray(tokenizer) scopes := findScopes(tokens) return walk(scopes) }
go
func generateDoc(htmlSrc string) string { tokenizer := xhtml.NewTokenizer(strings.NewReader(htmlSrc)) tokens := buildTokenArray(tokenizer) scopes := findScopes(tokens) return walk(scopes) }
[ "func", "generateDoc", "(", "htmlSrc", "string", ")", "string", "{", "tokenizer", ":=", "xhtml", ".", "NewTokenizer", "(", "strings", ".", "NewReader", "(", "htmlSrc", ")", ")", "\n", "tokens", ":=", "buildTokenArray", "(", "tokenizer", ")", "\n", "scopes", ":=", "findScopes", "(", "tokens", ")", "\n", "return", "walk", "(", "scopes", ")", "\n", "}" ]
// generateDoc will generate the proper doc string for html encoded or plain text doc entries.
[ "generateDoc", "will", "generate", "the", "proper", "doc", "string", "for", "html", "encoded", "or", "plain", "text", "doc", "entries", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/docstring.go#L217-L222
train
aws/aws-sdk-go
private/model/api/docstring.go
walk
func walk(scopes [][]tagInfo) string { doc := "" // Documentation will be chunked by scopes. // Meaning, for each scope will be divided by one or more newlines. for _, scope := range scopes { indentStr, isIndented := priorityIndentation(scope) block := "" href := "" after := false level := 0 lastTag := "" for _, token := range scope { if token.closingTag { endl := closeTag(token, level) block += endl level-- lastTag = "" } else if token.txt == "" { if token.val != "" { href, after = formatText(token, "") } if level == 1 && isIndented { block += indentStr } level++ lastTag = token.tag } else { if token.txt != " " { str, _ := formatText(token, lastTag) block += str if after { block += href after = false } } else { fmt.Println(token.tag) str, _ := formatText(tagInfo{}, lastTag) block += str } } } if !isIndented { block = strings.TrimPrefix(block, " ") } block = wrap(block, 72, isIndented) doc += block } return doc }
go
func walk(scopes [][]tagInfo) string { doc := "" // Documentation will be chunked by scopes. // Meaning, for each scope will be divided by one or more newlines. for _, scope := range scopes { indentStr, isIndented := priorityIndentation(scope) block := "" href := "" after := false level := 0 lastTag := "" for _, token := range scope { if token.closingTag { endl := closeTag(token, level) block += endl level-- lastTag = "" } else if token.txt == "" { if token.val != "" { href, after = formatText(token, "") } if level == 1 && isIndented { block += indentStr } level++ lastTag = token.tag } else { if token.txt != " " { str, _ := formatText(token, lastTag) block += str if after { block += href after = false } } else { fmt.Println(token.tag) str, _ := formatText(tagInfo{}, lastTag) block += str } } } if !isIndented { block = strings.TrimPrefix(block, " ") } block = wrap(block, 72, isIndented) doc += block } return doc }
[ "func", "walk", "(", "scopes", "[", "]", "[", "]", "tagInfo", ")", "string", "{", "doc", ":=", "\"", "\"", "\n", "// Documentation will be chunked by scopes.", "// Meaning, for each scope will be divided by one or more newlines.", "for", "_", ",", "scope", ":=", "range", "scopes", "{", "indentStr", ",", "isIndented", ":=", "priorityIndentation", "(", "scope", ")", "\n", "block", ":=", "\"", "\"", "\n", "href", ":=", "\"", "\"", "\n", "after", ":=", "false", "\n", "level", ":=", "0", "\n", "lastTag", ":=", "\"", "\"", "\n", "for", "_", ",", "token", ":=", "range", "scope", "{", "if", "token", ".", "closingTag", "{", "endl", ":=", "closeTag", "(", "token", ",", "level", ")", "\n", "block", "+=", "endl", "\n", "level", "--", "\n", "lastTag", "=", "\"", "\"", "\n", "}", "else", "if", "token", ".", "txt", "==", "\"", "\"", "{", "if", "token", ".", "val", "!=", "\"", "\"", "{", "href", ",", "after", "=", "formatText", "(", "token", ",", "\"", "\"", ")", "\n", "}", "\n", "if", "level", "==", "1", "&&", "isIndented", "{", "block", "+=", "indentStr", "\n", "}", "\n", "level", "++", "\n", "lastTag", "=", "token", ".", "tag", "\n", "}", "else", "{", "if", "token", ".", "txt", "!=", "\"", "\"", "{", "str", ",", "_", ":=", "formatText", "(", "token", ",", "lastTag", ")", "\n", "block", "+=", "str", "\n", "if", "after", "{", "block", "+=", "href", "\n", "after", "=", "false", "\n", "}", "\n", "}", "else", "{", "fmt", ".", "Println", "(", "token", ".", "tag", ")", "\n", "str", ",", "_", ":=", "formatText", "(", "tagInfo", "{", "}", ",", "lastTag", ")", "\n", "block", "+=", "str", "\n", "}", "\n", "}", "\n", "}", "\n", "if", "!", "isIndented", "{", "block", "=", "strings", ".", "TrimPrefix", "(", "block", ",", "\"", "\"", ")", "\n", "}", "\n", "block", "=", "wrap", "(", "block", ",", "72", ",", "isIndented", ")", "\n", "doc", "+=", "block", "\n", "}", "\n", "return", "doc", "\n", "}" ]
// walk is used to traverse each scoped block. These scoped // blocks will act as blocked text where we do most of our // text manipulation.
[ "walk", "is", "used", "to", "traverse", "each", "scoped", "block", ".", "These", "scoped", "blocks", "will", "act", "as", "blocked", "text", "where", "we", "do", "most", "of", "our", "text", "manipulation", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/docstring.go#L272-L320
train
aws/aws-sdk-go
private/model/api/docstring.go
formatText
func formatText(token tagInfo, lastTag string) (string, bool) { switch token.tag { case "a": if token.val != "" { return fmt.Sprintf(" (%s)", token.val), true } } // We don't care about a single space nor no text. if len(token.txt) == 0 || token.txt == " " { return "", false } // Here we want to indent code blocks that are newlines if lastTag == "code" { // Greater than one, because we don't care about newlines in the beginning block := "" if lines := strings.Split(token.txt, "\n"); len(lines) > 1 { for _, line := range lines { block += indent + line } block += "\n" return block, false } } return token.txt, false }
go
func formatText(token tagInfo, lastTag string) (string, bool) { switch token.tag { case "a": if token.val != "" { return fmt.Sprintf(" (%s)", token.val), true } } // We don't care about a single space nor no text. if len(token.txt) == 0 || token.txt == " " { return "", false } // Here we want to indent code blocks that are newlines if lastTag == "code" { // Greater than one, because we don't care about newlines in the beginning block := "" if lines := strings.Split(token.txt, "\n"); len(lines) > 1 { for _, line := range lines { block += indent + line } block += "\n" return block, false } } return token.txt, false }
[ "func", "formatText", "(", "token", "tagInfo", ",", "lastTag", "string", ")", "(", "string", ",", "bool", ")", "{", "switch", "token", ".", "tag", "{", "case", "\"", "\"", ":", "if", "token", ".", "val", "!=", "\"", "\"", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "token", ".", "val", ")", ",", "true", "\n", "}", "\n", "}", "\n\n", "// We don't care about a single space nor no text.", "if", "len", "(", "token", ".", "txt", ")", "==", "0", "||", "token", ".", "txt", "==", "\"", "\"", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n\n", "// Here we want to indent code blocks that are newlines", "if", "lastTag", "==", "\"", "\"", "{", "// Greater than one, because we don't care about newlines in the beginning", "block", ":=", "\"", "\"", "\n", "if", "lines", ":=", "strings", ".", "Split", "(", "token", ".", "txt", ",", "\"", "\\n", "\"", ")", ";", "len", "(", "lines", ")", ">", "1", "{", "for", "_", ",", "line", ":=", "range", "lines", "{", "block", "+=", "indent", "+", "line", "\n", "}", "\n", "block", "+=", "\"", "\\n", "\"", "\n", "return", "block", ",", "false", "\n", "}", "\n", "}", "\n", "return", "token", ".", "txt", ",", "false", "\n", "}" ]
// formatText will format any sort of text based off of a tag. It will also return // a boolean to add the string after the text token.
[ "formatText", "will", "format", "any", "sort", "of", "text", "based", "off", "of", "a", "tag", ".", "It", "will", "also", "return", "a", "boolean", "to", "add", "the", "string", "after", "the", "text", "token", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/docstring.go#L340-L366
train
aws/aws-sdk-go
private/model/api/docstring.go
priorityIndentation
func priorityIndentation(blocks []tagInfo) (string, bool) { if len(blocks) == 0 { return "", false } v, ok := style[blocks[0].tag] return v, ok }
go
func priorityIndentation(blocks []tagInfo) (string, bool) { if len(blocks) == 0 { return "", false } v, ok := style[blocks[0].tag] return v, ok }
[ "func", "priorityIndentation", "(", "blocks", "[", "]", "tagInfo", ")", "(", "string", ",", "bool", ")", "{", "if", "len", "(", "blocks", ")", "==", "0", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n\n", "v", ",", "ok", ":=", "style", "[", "blocks", "[", "0", "]", ".", "tag", "]", "\n", "return", "v", ",", "ok", "\n", "}" ]
// This is a parser to check what type of indention is needed.
[ "This", "is", "a", "parser", "to", "check", "what", "type", "of", "indention", "is", "needed", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/docstring.go#L369-L376
train
aws/aws-sdk-go
private/model/api/customization_passes.go
customizationPasses
func (a *API) customizationPasses() { var svcCustomizations = map[string]func(*API){ "s3": s3Customizations, "s3control": s3ControlCustomizations, "cloudfront": cloudfrontCustomizations, "rds": rdsCustomizations, // Disable endpoint resolving for services that require customer // to provide endpoint them selves. "cloudsearchdomain": disableEndpointResolving, "iotdataplane": disableEndpointResolving, // MTurk smoke test is invalid. The service requires AWS account to be // linked to Amazon Mechanical Turk Account. "mturk": supressSmokeTest, // Backfill the authentication type for cognito identity and sts. // Removes the need for the customizations in these services. "cognitoidentity": backfillAuthType("none", "GetId", "GetOpenIdToken", "UnlinkIdentity", "GetCredentialsForIdentity", ), "sts": backfillAuthType("none", "AssumeRoleWithSAML", "AssumeRoleWithWebIdentity", ), } for k := range mergeServices { svcCustomizations[k] = mergeServicesCustomizations } if fn := svcCustomizations[a.PackageName()]; fn != nil { fn(a) } }
go
func (a *API) customizationPasses() { var svcCustomizations = map[string]func(*API){ "s3": s3Customizations, "s3control": s3ControlCustomizations, "cloudfront": cloudfrontCustomizations, "rds": rdsCustomizations, // Disable endpoint resolving for services that require customer // to provide endpoint them selves. "cloudsearchdomain": disableEndpointResolving, "iotdataplane": disableEndpointResolving, // MTurk smoke test is invalid. The service requires AWS account to be // linked to Amazon Mechanical Turk Account. "mturk": supressSmokeTest, // Backfill the authentication type for cognito identity and sts. // Removes the need for the customizations in these services. "cognitoidentity": backfillAuthType("none", "GetId", "GetOpenIdToken", "UnlinkIdentity", "GetCredentialsForIdentity", ), "sts": backfillAuthType("none", "AssumeRoleWithSAML", "AssumeRoleWithWebIdentity", ), } for k := range mergeServices { svcCustomizations[k] = mergeServicesCustomizations } if fn := svcCustomizations[a.PackageName()]; fn != nil { fn(a) } }
[ "func", "(", "a", "*", "API", ")", "customizationPasses", "(", ")", "{", "var", "svcCustomizations", "=", "map", "[", "string", "]", "func", "(", "*", "API", ")", "{", "\"", "\"", ":", "s3Customizations", ",", "\"", "\"", ":", "s3ControlCustomizations", ",", "\"", "\"", ":", "cloudfrontCustomizations", ",", "\"", "\"", ":", "rdsCustomizations", ",", "// Disable endpoint resolving for services that require customer", "// to provide endpoint them selves.", "\"", "\"", ":", "disableEndpointResolving", ",", "\"", "\"", ":", "disableEndpointResolving", ",", "// MTurk smoke test is invalid. The service requires AWS account to be", "// linked to Amazon Mechanical Turk Account.", "\"", "\"", ":", "supressSmokeTest", ",", "// Backfill the authentication type for cognito identity and sts.", "// Removes the need for the customizations in these services.", "\"", "\"", ":", "backfillAuthType", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", ")", ",", "\"", "\"", ":", "backfillAuthType", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", ")", ",", "}", "\n\n", "for", "k", ":=", "range", "mergeServices", "{", "svcCustomizations", "[", "k", "]", "=", "mergeServicesCustomizations", "\n", "}", "\n\n", "if", "fn", ":=", "svcCustomizations", "[", "a", ".", "PackageName", "(", ")", "]", ";", "fn", "!=", "nil", "{", "fn", "(", "a", ")", "\n", "}", "\n", "}" ]
// customizationPasses Executes customization logic for the API by package name.
[ "customizationPasses", "Executes", "customization", "logic", "for", "the", "API", "by", "package", "name", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/customization_passes.go#L46-L83
train
aws/aws-sdk-go
private/model/api/customization_passes.go
s3Customizations
func s3Customizations(a *API) { var strExpires *Shape var keepContentMD5Ref = map[string]struct{}{ "PutObjectInput": {}, "UploadPartInput": {}, } for name, s := range a.Shapes { // Remove ContentMD5 members unless specified otherwise. if _, keep := keepContentMD5Ref[name]; !keep { if _, have := s.MemberRefs["ContentMD5"]; have { delete(s.MemberRefs, "ContentMD5") } } // Generate getter methods for API operation fields used by customizations. for _, refName := range []string{"Bucket", "SSECustomerKey", "CopySourceSSECustomerKey"} { if ref, ok := s.MemberRefs[refName]; ok { ref.GenerateGetter = true } } // Expires should be a string not time.Time since the format is not // enforced by S3, and any value can be set to this field outside of the SDK. if strings.HasSuffix(name, "Output") { if ref, ok := s.MemberRefs["Expires"]; ok { if strExpires == nil { newShape := *ref.Shape strExpires = &newShape strExpires.Type = "string" strExpires.refs = []*ShapeRef{} } ref.Shape.removeRef(ref) ref.Shape = strExpires ref.Shape.refs = append(ref.Shape.refs, &s.MemberRef) } } } s3CustRemoveHeadObjectModeledErrors(a) }
go
func s3Customizations(a *API) { var strExpires *Shape var keepContentMD5Ref = map[string]struct{}{ "PutObjectInput": {}, "UploadPartInput": {}, } for name, s := range a.Shapes { // Remove ContentMD5 members unless specified otherwise. if _, keep := keepContentMD5Ref[name]; !keep { if _, have := s.MemberRefs["ContentMD5"]; have { delete(s.MemberRefs, "ContentMD5") } } // Generate getter methods for API operation fields used by customizations. for _, refName := range []string{"Bucket", "SSECustomerKey", "CopySourceSSECustomerKey"} { if ref, ok := s.MemberRefs[refName]; ok { ref.GenerateGetter = true } } // Expires should be a string not time.Time since the format is not // enforced by S3, and any value can be set to this field outside of the SDK. if strings.HasSuffix(name, "Output") { if ref, ok := s.MemberRefs["Expires"]; ok { if strExpires == nil { newShape := *ref.Shape strExpires = &newShape strExpires.Type = "string" strExpires.refs = []*ShapeRef{} } ref.Shape.removeRef(ref) ref.Shape = strExpires ref.Shape.refs = append(ref.Shape.refs, &s.MemberRef) } } } s3CustRemoveHeadObjectModeledErrors(a) }
[ "func", "s3Customizations", "(", "a", "*", "API", ")", "{", "var", "strExpires", "*", "Shape", "\n\n", "var", "keepContentMD5Ref", "=", "map", "[", "string", "]", "struct", "{", "}", "{", "\"", "\"", ":", "{", "}", ",", "\"", "\"", ":", "{", "}", ",", "}", "\n\n", "for", "name", ",", "s", ":=", "range", "a", ".", "Shapes", "{", "// Remove ContentMD5 members unless specified otherwise.", "if", "_", ",", "keep", ":=", "keepContentMD5Ref", "[", "name", "]", ";", "!", "keep", "{", "if", "_", ",", "have", ":=", "s", ".", "MemberRefs", "[", "\"", "\"", "]", ";", "have", "{", "delete", "(", "s", ".", "MemberRefs", ",", "\"", "\"", ")", "\n", "}", "\n", "}", "\n\n", "// Generate getter methods for API operation fields used by customizations.", "for", "_", ",", "refName", ":=", "range", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", "}", "{", "if", "ref", ",", "ok", ":=", "s", ".", "MemberRefs", "[", "refName", "]", ";", "ok", "{", "ref", ".", "GenerateGetter", "=", "true", "\n", "}", "\n", "}", "\n\n", "// Expires should be a string not time.Time since the format is not", "// enforced by S3, and any value can be set to this field outside of the SDK.", "if", "strings", ".", "HasSuffix", "(", "name", ",", "\"", "\"", ")", "{", "if", "ref", ",", "ok", ":=", "s", ".", "MemberRefs", "[", "\"", "\"", "]", ";", "ok", "{", "if", "strExpires", "==", "nil", "{", "newShape", ":=", "*", "ref", ".", "Shape", "\n", "strExpires", "=", "&", "newShape", "\n", "strExpires", ".", "Type", "=", "\"", "\"", "\n", "strExpires", ".", "refs", "=", "[", "]", "*", "ShapeRef", "{", "}", "\n", "}", "\n", "ref", ".", "Shape", ".", "removeRef", "(", "ref", ")", "\n", "ref", ".", "Shape", "=", "strExpires", "\n", "ref", ".", "Shape", ".", "refs", "=", "append", "(", "ref", ".", "Shape", ".", "refs", ",", "&", "s", ".", "MemberRef", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "s3CustRemoveHeadObjectModeledErrors", "(", "a", ")", "\n", "}" ]
// s3Customizations customizes the API generation to replace values specific to S3.
[ "s3Customizations", "customizes", "the", "API", "generation", "to", "replace", "values", "specific", "to", "S3", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/customization_passes.go#L90-L130
train
aws/aws-sdk-go
private/model/api/customization_passes.go
s3ControlCustomizations
func s3ControlCustomizations(a *API) { for opName, op := range a.Operations { // Add moving AccountId into the hostname instead of header. if ref, ok := op.InputRef.Shape.MemberRefs["AccountId"]; ok { if op.Endpoint != nil { fmt.Fprintf(os.Stderr, "S3 Control, %s, model already defining endpoint trait, remove this customization.\n", opName) } op.Endpoint = &EndpointTrait{HostPrefix: "{AccountId}."} ref.HostLabel = true } } }
go
func s3ControlCustomizations(a *API) { for opName, op := range a.Operations { // Add moving AccountId into the hostname instead of header. if ref, ok := op.InputRef.Shape.MemberRefs["AccountId"]; ok { if op.Endpoint != nil { fmt.Fprintf(os.Stderr, "S3 Control, %s, model already defining endpoint trait, remove this customization.\n", opName) } op.Endpoint = &EndpointTrait{HostPrefix: "{AccountId}."} ref.HostLabel = true } } }
[ "func", "s3ControlCustomizations", "(", "a", "*", "API", ")", "{", "for", "opName", ",", "op", ":=", "range", "a", ".", "Operations", "{", "// Add moving AccountId into the hostname instead of header.", "if", "ref", ",", "ok", ":=", "op", ".", "InputRef", ".", "Shape", ".", "MemberRefs", "[", "\"", "\"", "]", ";", "ok", "{", "if", "op", ".", "Endpoint", "!=", "nil", "{", "fmt", ".", "Fprintf", "(", "os", ".", "Stderr", ",", "\"", "\\n", "\"", ",", "opName", ")", "\n", "}", "\n\n", "op", ".", "Endpoint", "=", "&", "EndpointTrait", "{", "HostPrefix", ":", "\"", "\"", "}", "\n", "ref", ".", "HostLabel", "=", "true", "\n", "}", "\n", "}", "\n", "}" ]
// S3 service operations with an AccountId need accessors to be generated for // them so the fields can be dynamically accessed without reflection.
[ "S3", "service", "operations", "with", "an", "AccountId", "need", "accessors", "to", "be", "generated", "for", "them", "so", "the", "fields", "can", "be", "dynamically", "accessed", "without", "reflection", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/customization_passes.go#L152-L164
train
aws/aws-sdk-go
private/model/api/customization_passes.go
cloudfrontCustomizations
func cloudfrontCustomizations(a *API) { // MaxItems members should always be integers for _, s := range a.Shapes { if ref, ok := s.MemberRefs["MaxItems"]; ok { ref.ShapeName = "Integer" ref.Shape = a.Shapes["Integer"] } } }
go
func cloudfrontCustomizations(a *API) { // MaxItems members should always be integers for _, s := range a.Shapes { if ref, ok := s.MemberRefs["MaxItems"]; ok { ref.ShapeName = "Integer" ref.Shape = a.Shapes["Integer"] } } }
[ "func", "cloudfrontCustomizations", "(", "a", "*", "API", ")", "{", "// MaxItems members should always be integers", "for", "_", ",", "s", ":=", "range", "a", ".", "Shapes", "{", "if", "ref", ",", "ok", ":=", "s", ".", "MemberRefs", "[", "\"", "\"", "]", ";", "ok", "{", "ref", ".", "ShapeName", "=", "\"", "\"", "\n", "ref", ".", "Shape", "=", "a", ".", "Shapes", "[", "\"", "\"", "]", "\n", "}", "\n", "}", "\n", "}" ]
// cloudfrontCustomizations customized the API generation to replace values // specific to CloudFront.
[ "cloudfrontCustomizations", "customized", "the", "API", "generation", "to", "replace", "values", "specific", "to", "CloudFront", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/customization_passes.go#L168-L176
train
aws/aws-sdk-go
private/model/api/customization_passes.go
mergeServicesCustomizations
func mergeServicesCustomizations(a *API) { info := mergeServices[a.PackageName()] p := strings.Replace(a.path, info.srcName, info.dstName, -1) if info.serviceVersion != "" { index := strings.LastIndex(p, string(filepath.Separator)) files, _ := ioutil.ReadDir(p[:index]) if len(files) > 1 { panic("New version was introduced") } p = p[:index] + "/" + info.serviceVersion } file := filepath.Join(p, "api-2.json") serviceAPI := API{} serviceAPI.Attach(file) serviceAPI.Setup() for n := range a.Shapes { if _, ok := serviceAPI.Shapes[n]; ok { a.Shapes[n].resolvePkg = SDKImportRoot + "/service/" + info.dstName } } }
go
func mergeServicesCustomizations(a *API) { info := mergeServices[a.PackageName()] p := strings.Replace(a.path, info.srcName, info.dstName, -1) if info.serviceVersion != "" { index := strings.LastIndex(p, string(filepath.Separator)) files, _ := ioutil.ReadDir(p[:index]) if len(files) > 1 { panic("New version was introduced") } p = p[:index] + "/" + info.serviceVersion } file := filepath.Join(p, "api-2.json") serviceAPI := API{} serviceAPI.Attach(file) serviceAPI.Setup() for n := range a.Shapes { if _, ok := serviceAPI.Shapes[n]; ok { a.Shapes[n].resolvePkg = SDKImportRoot + "/service/" + info.dstName } } }
[ "func", "mergeServicesCustomizations", "(", "a", "*", "API", ")", "{", "info", ":=", "mergeServices", "[", "a", ".", "PackageName", "(", ")", "]", "\n\n", "p", ":=", "strings", ".", "Replace", "(", "a", ".", "path", ",", "info", ".", "srcName", ",", "info", ".", "dstName", ",", "-", "1", ")", "\n\n", "if", "info", ".", "serviceVersion", "!=", "\"", "\"", "{", "index", ":=", "strings", ".", "LastIndex", "(", "p", ",", "string", "(", "filepath", ".", "Separator", ")", ")", "\n", "files", ",", "_", ":=", "ioutil", ".", "ReadDir", "(", "p", "[", ":", "index", "]", ")", "\n", "if", "len", "(", "files", ")", ">", "1", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "p", "=", "p", "[", ":", "index", "]", "+", "\"", "\"", "+", "info", ".", "serviceVersion", "\n", "}", "\n\n", "file", ":=", "filepath", ".", "Join", "(", "p", ",", "\"", "\"", ")", "\n\n", "serviceAPI", ":=", "API", "{", "}", "\n", "serviceAPI", ".", "Attach", "(", "file", ")", "\n", "serviceAPI", ".", "Setup", "(", ")", "\n\n", "for", "n", ":=", "range", "a", ".", "Shapes", "{", "if", "_", ",", "ok", ":=", "serviceAPI", ".", "Shapes", "[", "n", "]", ";", "ok", "{", "a", ".", "Shapes", "[", "n", "]", ".", "resolvePkg", "=", "SDKImportRoot", "+", "\"", "\"", "+", "info", ".", "dstName", "\n", "}", "\n", "}", "\n", "}" ]
// mergeServicesCustomizations references any duplicate shapes from DynamoDB
[ "mergeServicesCustomizations", "references", "any", "duplicate", "shapes", "from", "DynamoDB" ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/private/model/api/customization_passes.go#L179-L204
train
aws/aws-sdk-go
service/ses/api.go
SetHtml
func (s *Body) SetHtml(v *Content) *Body { s.Html = v return s }
go
func (s *Body) SetHtml(v *Content) *Body { s.Html = v return s }
[ "func", "(", "s", "*", "Body", ")", "SetHtml", "(", "v", "*", "Content", ")", "*", "Body", "{", "s", ".", "Html", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetHtml sets the Html field's value.
[ "SetHtml", "sets", "the", "Html", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6576-L6579
train
aws/aws-sdk-go
service/ses/api.go
SetSender
func (s *BounceAction) SetSender(v string) *BounceAction { s.Sender = &v return s }
go
func (s *BounceAction) SetSender(v string) *BounceAction { s.Sender = &v return s }
[ "func", "(", "s", "*", "BounceAction", ")", "SetSender", "(", "v", "string", ")", "*", "BounceAction", "{", "s", ".", "Sender", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetSender sets the Sender field's value.
[ "SetSender", "sets", "the", "Sender", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6658-L6661
train
aws/aws-sdk-go
service/ses/api.go
SetSmtpReplyCode
func (s *BounceAction) SetSmtpReplyCode(v string) *BounceAction { s.SmtpReplyCode = &v return s }
go
func (s *BounceAction) SetSmtpReplyCode(v string) *BounceAction { s.SmtpReplyCode = &v return s }
[ "func", "(", "s", "*", "BounceAction", ")", "SetSmtpReplyCode", "(", "v", "string", ")", "*", "BounceAction", "{", "s", ".", "SmtpReplyCode", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetSmtpReplyCode sets the SmtpReplyCode field's value.
[ "SetSmtpReplyCode", "sets", "the", "SmtpReplyCode", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6664-L6667
train
aws/aws-sdk-go
service/ses/api.go
SetBounceType
func (s *BouncedRecipientInfo) SetBounceType(v string) *BouncedRecipientInfo { s.BounceType = &v return s }
go
func (s *BouncedRecipientInfo) SetBounceType(v string) *BouncedRecipientInfo { s.BounceType = &v return s }
[ "func", "(", "s", "*", "BouncedRecipientInfo", ")", "SetBounceType", "(", "v", "string", ")", "*", "BouncedRecipientInfo", "{", "s", ".", "BounceType", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetBounceType sets the BounceType field's value.
[ "SetBounceType", "sets", "the", "BounceType", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6738-L6741
train
aws/aws-sdk-go
service/ses/api.go
SetRecipient
func (s *BouncedRecipientInfo) SetRecipient(v string) *BouncedRecipientInfo { s.Recipient = &v return s }
go
func (s *BouncedRecipientInfo) SetRecipient(v string) *BouncedRecipientInfo { s.Recipient = &v return s }
[ "func", "(", "s", "*", "BouncedRecipientInfo", ")", "SetRecipient", "(", "v", "string", ")", "*", "BouncedRecipientInfo", "{", "s", ".", "Recipient", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetRecipient sets the Recipient field's value.
[ "SetRecipient", "sets", "the", "Recipient", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6744-L6747
train
aws/aws-sdk-go
service/ses/api.go
SetRecipientArn
func (s *BouncedRecipientInfo) SetRecipientArn(v string) *BouncedRecipientInfo { s.RecipientArn = &v return s }
go
func (s *BouncedRecipientInfo) SetRecipientArn(v string) *BouncedRecipientInfo { s.RecipientArn = &v return s }
[ "func", "(", "s", "*", "BouncedRecipientInfo", ")", "SetRecipientArn", "(", "v", "string", ")", "*", "BouncedRecipientInfo", "{", "s", ".", "RecipientArn", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetRecipientArn sets the RecipientArn field's value.
[ "SetRecipientArn", "sets", "the", "RecipientArn", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6750-L6753
train
aws/aws-sdk-go
service/ses/api.go
SetRecipientDsnFields
func (s *BouncedRecipientInfo) SetRecipientDsnFields(v *RecipientDsnFields) *BouncedRecipientInfo { s.RecipientDsnFields = v return s }
go
func (s *BouncedRecipientInfo) SetRecipientDsnFields(v *RecipientDsnFields) *BouncedRecipientInfo { s.RecipientDsnFields = v return s }
[ "func", "(", "s", "*", "BouncedRecipientInfo", ")", "SetRecipientDsnFields", "(", "v", "*", "RecipientDsnFields", ")", "*", "BouncedRecipientInfo", "{", "s", ".", "RecipientDsnFields", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetRecipientDsnFields sets the RecipientDsnFields field's value.
[ "SetRecipientDsnFields", "sets", "the", "RecipientDsnFields", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6756-L6759
train
aws/aws-sdk-go
service/ses/api.go
SetReplacementTags
func (s *BulkEmailDestination) SetReplacementTags(v []*MessageTag) *BulkEmailDestination { s.ReplacementTags = v return s }
go
func (s *BulkEmailDestination) SetReplacementTags(v []*MessageTag) *BulkEmailDestination { s.ReplacementTags = v return s }
[ "func", "(", "s", "*", "BulkEmailDestination", ")", "SetReplacementTags", "(", "v", "[", "]", "*", "MessageTag", ")", "*", "BulkEmailDestination", "{", "s", ".", "ReplacementTags", "=", "v", "\n", "return", "s", "\n", "}" ]
// SetReplacementTags sets the ReplacementTags field's value.
[ "SetReplacementTags", "sets", "the", "ReplacementTags", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6831-L6834
train
aws/aws-sdk-go
service/ses/api.go
SetReplacementTemplateData
func (s *BulkEmailDestination) SetReplacementTemplateData(v string) *BulkEmailDestination { s.ReplacementTemplateData = &v return s }
go
func (s *BulkEmailDestination) SetReplacementTemplateData(v string) *BulkEmailDestination { s.ReplacementTemplateData = &v return s }
[ "func", "(", "s", "*", "BulkEmailDestination", ")", "SetReplacementTemplateData", "(", "v", "string", ")", "*", "BulkEmailDestination", "{", "s", ".", "ReplacementTemplateData", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetReplacementTemplateData sets the ReplacementTemplateData field's value.
[ "SetReplacementTemplateData", "sets", "the", "ReplacementTemplateData", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6837-L6840
train
aws/aws-sdk-go
service/ses/api.go
SetOriginalRuleSetName
func (s *CloneReceiptRuleSetInput) SetOriginalRuleSetName(v string) *CloneReceiptRuleSetInput { s.OriginalRuleSetName = &v return s }
go
func (s *CloneReceiptRuleSetInput) SetOriginalRuleSetName(v string) *CloneReceiptRuleSetInput { s.OriginalRuleSetName = &v return s }
[ "func", "(", "s", "*", "CloneReceiptRuleSetInput", ")", "SetOriginalRuleSetName", "(", "v", "string", ")", "*", "CloneReceiptRuleSetInput", "{", "s", ".", "OriginalRuleSetName", "=", "&", "v", "\n", "return", "s", "\n", "}" ]
// SetOriginalRuleSetName sets the OriginalRuleSetName field's value.
[ "SetOriginalRuleSetName", "sets", "the", "OriginalRuleSetName", "field", "s", "value", "." ]
6c4060605190fc6f00d63cd4e5572faa9f07345d
https://github.com/aws/aws-sdk-go/blob/6c4060605190fc6f00d63cd4e5572faa9f07345d/service/ses/api.go#L6979-L6982
train