Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion codegen/layouts/partials/client-method.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
raise TypeError, "At least one parameter is required for {{path}}"
end

{{/if}} {{#if usesRes}}res = {{/if}}@client.post("{{path}}"{{#if hasParams}}, {{bodyParams}}.compact{{/if}})
{{/if}} {{#if usesRes}}res = {{/if}}@client.{{httpMethod}}("{{path}}"{{#if hasParams}}, {{bodyParams}}.compact{{/if}})
{{#if isResource}}

Seam::Resources::{{returnResource}}.load_from_response(res.body["{{returnPath}}"])
Expand Down
11 changes: 10 additions & 1 deletion codegen/lib/layouts/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface ClientMethodLayoutContext {
isResource: boolean
isPoll: boolean
isNil: boolean
httpMethod: string
returnResource: string
returnPath: string
}
Expand All @@ -39,7 +40,14 @@ export interface ClientLayoutContext {
const getMethodLayoutContext = (
method: ClientMethod,
): ClientMethodLayoutContext => {
const { methodName, path, parameters, returnResource, returnPath } = method
const {
methodName,
path,
parameters,
returnResource,
returnPath,
httpMethod,
} = method

const hasReturnValue = returnResource != null && returnPath !== ''
const canPollActionAttempt = returnPath === 'action_attempt'
Expand Down Expand Up @@ -73,6 +81,7 @@ const getMethodLayoutContext = (
hasParams,
bodyParams,
path,
httpMethod: httpMethod.toLowerCase(),
usesRes: isResource || isPoll,
isResource,
isPoll,
Expand Down
1 change: 1 addition & 0 deletions codegen/lib/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ const createClientMethod = (endpoint: Endpoint): ClientMethod => {

return {
methodName: endpoint.name,
httpMethod: endpoint.request.preferredMethod,
description: endpoint.description,
isDeprecated: endpoint.isDeprecated,
deprecationMessage: endpoint.deprecationMessage,
Expand Down
1 change: 1 addition & 0 deletions codegen/lib/ruby-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface ClientMethodParameter {

export interface ClientMethod {
methodName: string
httpMethod: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH'
description: string
isDeprecated: boolean
deprecationMessage: string
Expand Down
12 changes: 6 additions & 6 deletions lib/seam/routes/access_codes.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions lib/seam/routes/access_codes_unmanaged.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/seam/routes/access_grants.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/seam/routes/access_grants_unmanaged.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/seam/routes/access_methods.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/seam/routes/access_methods_unmanaged.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading