Skip to content

Commit

Permalink
hardcode optional params
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Nov 3, 2022
1 parent 04756a6 commit 1935d4b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
24 changes: 15 additions & 9 deletions playground/go/ingestion.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ func main() {
apiKey := os.Getenv("ALGOLIA_ADMIN_KEY")
client := ingestion.NewClient(appID, apiKey, ingestion.US)

auth, err := client.CreateAuthentication(ingestion.NewAuthenticationCreate(
ingestion.AUTHENTICATIONTYPE_ALGOLIA,
"test-auth-2",
ingestion.AuthAlgoliaAsAuthInput(ingestion.NewAuthAlgolia(appID, apiKey))))
auths, err := client.GetAuthentications(ingestion.WithPage(22), ingestion.WithItemsPerPage(15))

if err != nil {
fmt.Println(err)
fmt.Println(auths.GetPagination(), err)

return
}
fmt.Println(auth)
/*
auth, err := client.CreateAuthentication(ingestion.NewAuthenticationCreate(
ingestion.AUTHENTICATIONTYPE_ALGOLIA,
"test-auth-2",
ingestion.AuthAlgoliaAsAuthInput(ingestion.NewAuthAlgolia(appID, apiKey))))
if err != nil {
fmt.Println(err)
return
}
fmt.Println(auth)*/
/*
dest, err := client.CreateDestination(ingestion.NewDestinationCreate(
ingestion.DESTINATIONTYPE_SEARCH,
Expand Down
4 changes: 2 additions & 2 deletions specs/ingestion/common/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ taskID:
itemsPerPage:
name: itemsPerPage
in: query
description: The number of items per page to return
description: The number of items per page to return.
required: false
schema:
type: integer

page:
name: page
in: query
description: The page number to fetch, starting at 1
description: The page number to fetch, starting at 1.
required: false
schema:
type: integer
2 changes: 1 addition & 1 deletion templates/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
{{#isDeprecated}}
// Deprecated
{{/isDeprecated}}
func (c *APIClient) {{nickname}}({{#allParams}}{{paramName}} {{^isArray}}{{^isPrimitiveType}}*{{/isPrimitiveType}}{{/isArray}}{{{dataType}}}{{^-last}},{{/-last}}{{/allParams}}) ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}error) {
func (c *APIClient) {{nickname}}({{#requiredParams}}{{paramName}} {{^isArray}}{{^isPrimitiveType}}*{{/isPrimitiveType}}{{/isArray}}{{{dataType}}}{{^-last}},{{/-last}}{{/requiredParams}}) ({{#returnType}}{{^isArray}}{{^returnTypeIsPrimitive}}*{{/returnTypeIsPrimitive}}{{/isArray}}{{{.}}}, {{/returnType}}error) {
var (
body interface{}
{{#returnType}}
Expand Down

0 comments on commit 1935d4b

Please sign in to comment.