Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private/model/api: adding deprecation string to doc string #2129

Merged
merged 6 commits into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adding deprecated standand message in doc string
modifying deprecation template for operations

modifying message
  • Loading branch information
xibz committed Sep 4, 2018
commit 8d558f90deab4d5aeaf97660dc408826a71438df
15 changes: 15 additions & 0 deletions private/model/api/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ const op{{ .ExportedName }} = "{{ .Name }}"
//
// See also, {{ $crosslinkURL }}
{{ end -}}
{{- if .Deprecated }}//
// Deprecated: {{ .ExportedName }}Request is a deprecated operation
{{ end -}}
func (c *{{ .API.StructName }}) {{ .ExportedName }}Request(` +
`input {{ .InputRef.GoType }}) (req *request.Request, output {{ .OutputRef.GoType }}) {
{{ if (or .Deprecated (or .InputRef.Deprecated .OutputRef.Deprecated)) }}if c.Client.Config.Logger != nil {
Expand Down Expand Up @@ -168,6 +171,9 @@ func (c *{{ .API.StructName }}) {{ .ExportedName }}Request(` +
{{ if ne $crosslinkURL "" -}}
// See also, {{ $crosslinkURL }}
{{ end -}}
{{- if .Deprecated }}//
// Deprecated: {{ .ExportedName }} is a deprecated operation
{{ end -}}
func (c *{{ .API.StructName }}) {{ .ExportedName }}(` +
`input {{ .InputRef.GoType }}) ({{ .OutputRef.GoType }}, error) {
req, out := c.{{ .ExportedName }}Request(input)
Expand All @@ -183,6 +189,9 @@ func (c *{{ .API.StructName }}) {{ .ExportedName }}(` +
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
{{ if .Deprecated }}//
// Deprecated: {{ .ExportedName }}WithContext is a deprecated operation
{{ end -}}
func (c *{{ .API.StructName }}) {{ .ExportedName }}WithContext(` +
`ctx aws.Context, input {{ .InputRef.GoType }}, opts ...request.Option) ` +
`({{ .OutputRef.GoType }}, error) {
Expand Down Expand Up @@ -210,6 +219,9 @@ func (c *{{ .API.StructName }}) {{ .ExportedName }}WithContext(` +
// return pageNum <= 3
// })
//
{{ if .Deprecated }}//
// Deprecated: {{ .ExportedName }}Pages is a deprecated paginator
{{ end -}}
func (c *{{ .API.StructName }}) {{ .ExportedName }}Pages(` +
`input {{ .InputRef.GoType }}, fn func({{ .OutputRef.GoType }}, bool) bool) error {
return c.{{ .ExportedName }}PagesWithContext(aws.BackgroundContext(), input, fn)
Expand All @@ -222,6 +234,9 @@ func (c *{{ .API.StructName }}) {{ .ExportedName }}Pages(` +
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
{{ if .Deprecated }}//
// Deprecated: {{ .ExportedName }}PagesWithContext is a deprecated paginator
{{ end -}}
func (c *{{ .API.StructName }}) {{ .ExportedName }}PagesWithContext(` +
`ctx aws.Context, ` +
`input {{ .InputRef.GoType }}, ` +
Expand Down
4 changes: 4 additions & 0 deletions private/model/api/shape.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,10 @@ type {{ .ShapeName }} struct {

{{ if $doc -}}
{{ $doc }}
{{ if $elem.Deprecated -}}
//
// Deprecated: {{ $name }} is a deprecated field
{{ end -}}
{{ end -}}
{{ if $isBlob -}}
{{ if $doc -}}
Expand Down