getValuesFromFlow puts the values from the OAuth Flow in a jen.Dict to generate it
(flow *openapi3.OAuthFlow)
| 128 | |
| 129 | // getValuesFromFlow puts the values from the OAuth Flow in a jen.Dict to generate it |
| 130 | func getValuesFromFlow(flow *openapi3.OAuthFlow) jen.Dict { |
| 131 | r := jen.Dict{} |
| 132 | r[jen.Id("AuthorizationURL")] = jen.Lit(flow.AuthorizationURL) |
| 133 | r[jen.Id("TokenURL")] = jen.Lit(flow.TokenURL) |
| 134 | r[jen.Id("RefreshURL")] = jen.Lit(flow.RefreshURL) |
| 135 | scopes := jen.Dict{} |
| 136 | for scope, descr := range flow.Scopes { |
| 137 | scopes[jen.Lit(scope)] = jen.Lit(descr) |
| 138 | } |
| 139 | r[jen.Id("Scopes")] = jen.Map(jen.String()).String().Values(scopes) |
| 140 | return r |
| 141 | } |
no test coverage detected
searching dependent graphs…