Skip to content

Commit ab13b46

Browse files
author
funlessdev
committed
1 parent 1104fc9 commit ab13b46

File tree

9 files changed

+313
-250
lines changed

9 files changed

+313
-250
lines changed

.openapi-generator/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.2.0-SNAPSHOT
1+
7.4.0-SNAPSHOT

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
1313

1414
Install the following dependencies:
1515

16-
```shell
16+
```sh
1717
go get github.com/stretchr/testify/assert
1818
go get golang.org/x/net/context
1919
```
2020

2121
Put the package under your project folder and add the following in import:
2222

23-
```golang
23+
```go
2424
import openapi "github.com/funlessdev/fl-client-sdk-go"
2525
```
2626

2727
To use a proxy, set the environment variable `HTTP_PROXY`:
2828

29-
```golang
29+
```go
3030
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
3131
```
3232

@@ -38,15 +38,15 @@ Default configuration comes with `Servers` field that contains server objects as
3838

3939
For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`.
4040

41-
```golang
41+
```go
4242
ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)
4343
```
4444

4545
### Templated Server URL
4646

4747
Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`.
4848

49-
```golang
49+
```go
5050
ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
5151
"basePath": "v2",
5252
})
@@ -60,7 +60,7 @@ Each operation can use different server URL defined using `OperationServers` map
6060
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
6161
Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps.
6262

63-
```golang
63+
```go
6464
ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
6565
"{classname}Service.{nickname}": 2,
6666
})

api/openapi.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,27 @@ components:
616616
type: array
617617
type: object
618618
mixed_results:
619+
example:
620+
data:
621+
sinks:
622+
- message: message
623+
status: success
624+
- message: message
625+
status: success
626+
sinks_metadata:
627+
total: 1
628+
failed: 6
629+
successful: 0
630+
events_metadata:
631+
total: 2
632+
failed: 5
633+
successful: 5
634+
name: name
635+
events:
636+
- message: message
637+
status: success
638+
- message: message
639+
status: success
619640
properties:
620641
data:
621642
$ref: '#/components/schemas/mixed_results_data'
@@ -640,6 +661,9 @@ components:
640661
$ref: '#/components/schemas/single_app_result_data'
641662
type: object
642663
error:
664+
example:
665+
errors:
666+
detail: detail
643667
properties:
644668
errors:
645669
$ref: '#/components/schemas/error_errors'
@@ -701,6 +725,9 @@ components:
701725
type: object
702726
type: object
703727
mixed_results_data_events_inner:
728+
example:
729+
message: message
730+
status: success
704731
properties:
705732
status:
706733
description: Whether the corresponding event was connected successfully
@@ -713,6 +740,9 @@ components:
713740
type: string
714741
type: object
715742
mixed_results_data_sinks_inner:
743+
example:
744+
message: message
745+
status: success
716746
properties:
717747
status:
718748
description: Whether the corresponding sink was connected successfully
@@ -725,6 +755,10 @@ components:
725755
type: string
726756
type: object
727757
mixed_results_data_sinks_metadata:
758+
example:
759+
total: 1
760+
failed: 6
761+
successful: 0
728762
properties:
729763
successful:
730764
description: The amount of data sinks that was successfully connected
@@ -737,6 +771,10 @@ components:
737771
type: integer
738772
type: object
739773
mixed_results_data_events_metadata:
774+
example:
775+
total: 2
776+
failed: 5
777+
successful: 5
740778
properties:
741779
successful:
742780
description: The amount of events that was successfully connected
@@ -749,6 +787,26 @@ components:
749787
type: integer
750788
type: object
751789
mixed_results_data:
790+
example:
791+
sinks:
792+
- message: message
793+
status: success
794+
- message: message
795+
status: success
796+
sinks_metadata:
797+
total: 1
798+
failed: 6
799+
successful: 0
800+
events_metadata:
801+
total: 2
802+
failed: 5
803+
successful: 5
804+
name: name
805+
events:
806+
- message: message
807+
status: success
808+
- message: message
809+
status: success
752810
properties:
753811
name:
754812
description: The name of the function
@@ -779,6 +837,8 @@ components:
779837
type: string
780838
type: object
781839
error_errors:
840+
example:
841+
detail: detail
782842
properties:
783843
detail:
784844
type: string

docs/AppAPI.md

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ Create new APP script
2525
package main
2626

2727
import (
28-
"context"
29-
"fmt"
30-
"os"
31-
openapiclient "github.com/funlessdev/fl-client-sdk-go"
28+
"context"
29+
"fmt"
30+
"os"
31+
openapiclient "github.com/funlessdev/fl-client-sdk-go"
3232
)
3333

3434
func main() {
35-
name := "name_example" // string | Name of the function (optional)
36-
code := os.NewFile(1234, "some_file") // *os.File | File with the code of the function (optional)
37-
waitForWorkers := true // bool | Whether to wait for all workers to receive the code of the function. If false, the request returns as soon as the creation request terminates. (optional) (default to true)
38-
events := []openapiclient.FunctionCreateUpdateEventsInner{*openapiclient.NewFunctionCreateUpdateEventsInner()} // []FunctionCreateUpdateEventsInner | Events that can trigger the function (optional)
39-
sinks := []openapiclient.FunctionCreateUpdateSinksInner{*openapiclient.NewFunctionCreateUpdateSinksInner()} // []FunctionCreateUpdateSinksInner | Data sinks that receive invocation's results (optional)
40-
41-
configuration := openapiclient.NewConfiguration()
42-
apiClient := openapiclient.NewAPIClient(configuration)
43-
r, err := apiClient.AppAPI.CreateApp(context.Background()).Name(name).Code(code).WaitForWorkers(waitForWorkers).Events(events).Sinks(sinks).Execute()
44-
if err != nil {
45-
fmt.Fprintf(os.Stderr, "Error when calling `AppAPI.CreateApp``: %v\n", err)
46-
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
47-
}
35+
name := "name_example" // string | Name of the function (optional)
36+
code := os.NewFile(1234, "some_file") // *os.File | File with the code of the function (optional)
37+
waitForWorkers := true // bool | Whether to wait for all workers to receive the code of the function. If false, the request returns as soon as the creation request terminates. (optional) (default to true)
38+
events := []openapiclient.FunctionCreateUpdateEventsInner{*openapiclient.NewFunctionCreateUpdateEventsInner()} // []FunctionCreateUpdateEventsInner | Events that can trigger the function (optional)
39+
sinks := []openapiclient.FunctionCreateUpdateSinksInner{*openapiclient.NewFunctionCreateUpdateSinksInner()} // []FunctionCreateUpdateSinksInner | Data sinks that receive invocation's results (optional)
40+
41+
configuration := openapiclient.NewConfiguration()
42+
apiClient := openapiclient.NewAPIClient(configuration)
43+
r, err := apiClient.AppAPI.CreateApp(context.Background()).Name(name).Code(code).WaitForWorkers(waitForWorkers).Events(events).Sinks(sinks).Execute()
44+
if err != nil {
45+
fmt.Fprintf(os.Stderr, "Error when calling `AppAPI.CreateApp``: %v\n", err)
46+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
47+
}
4848
}
4949
```
5050

@@ -97,22 +97,22 @@ Delete APP
9797
package main
9898

9999
import (
100-
"context"
101-
"fmt"
102-
"os"
103-
openapiclient "github.com/funlessdev/fl-client-sdk-go"
100+
"context"
101+
"fmt"
102+
"os"
103+
openapiclient "github.com/funlessdev/fl-client-sdk-go"
104104
)
105105

106106
func main() {
107-
moduleName := "moduleName_example" // string | The name of the module to retrieve
108-
109-
configuration := openapiclient.NewConfiguration()
110-
apiClient := openapiclient.NewAPIClient(configuration)
111-
r, err := apiClient.AppAPI.DeleteApp(context.Background(), moduleName).Execute()
112-
if err != nil {
113-
fmt.Fprintf(os.Stderr, "Error when calling `AppAPI.DeleteApp``: %v\n", err)
114-
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
115-
}
107+
moduleName := "moduleName_example" // string | The name of the module to retrieve
108+
109+
configuration := openapiclient.NewConfiguration()
110+
apiClient := openapiclient.NewAPIClient(configuration)
111+
r, err := apiClient.AppAPI.DeleteApp(context.Background(), moduleName).Execute()
112+
if err != nil {
113+
fmt.Fprintf(os.Stderr, "Error when calling `AppAPI.DeleteApp``: %v\n", err)
114+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
115+
}
116116
}
117117
```
118118

@@ -165,23 +165,23 @@ List current APP scripts
165165
package main
166166

167167
import (
168-
"context"
169-
"fmt"
170-
"os"
171-
openapiclient "github.com/funlessdev/fl-client-sdk-go"
168+
"context"
169+
"fmt"
170+
"os"
171+
openapiclient "github.com/funlessdev/fl-client-sdk-go"
172172
)
173173

174174
func main() {
175175

176-
configuration := openapiclient.NewConfiguration()
177-
apiClient := openapiclient.NewAPIClient(configuration)
178-
resp, r, err := apiClient.AppAPI.ListApp(context.Background()).Execute()
179-
if err != nil {
180-
fmt.Fprintf(os.Stderr, "Error when calling `AppAPI.ListApp``: %v\n", err)
181-
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
182-
}
183-
// response from `ListApp`: ModuleNamesResult
184-
fmt.Fprintf(os.Stdout, "Response from `AppAPI.ListApp`: %v\n", resp)
176+
configuration := openapiclient.NewConfiguration()
177+
apiClient := openapiclient.NewAPIClient(configuration)
178+
resp, r, err := apiClient.AppAPI.ListApp(context.Background()).Execute()
179+
if err != nil {
180+
fmt.Fprintf(os.Stderr, "Error when calling `AppAPI.ListApp``: %v\n", err)
181+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
182+
}
183+
// response from `ListApp`: ModuleNamesResult
184+
fmt.Fprintf(os.Stdout, "Response from `AppAPI.ListApp`: %v\n", resp)
185185
}
186186
```
187187

@@ -226,24 +226,24 @@ Show APP info
226226
package main
227227

228228
import (
229-
"context"
230-
"fmt"
231-
"os"
232-
openapiclient "github.com/funlessdev/fl-client-sdk-go"
229+
"context"
230+
"fmt"
231+
"os"
232+
openapiclient "github.com/funlessdev/fl-client-sdk-go"
233233
)
234234

235235
func main() {
236-
moduleName := "moduleName_example" // string | The name of the module to retrieve
237-
238-
configuration := openapiclient.NewConfiguration()
239-
apiClient := openapiclient.NewAPIClient(configuration)
240-
resp, r, err := apiClient.AppAPI.ShowAppByName(context.Background(), moduleName).Execute()
241-
if err != nil {
242-
fmt.Fprintf(os.Stderr, "Error when calling `AppAPI.ShowAppByName``: %v\n", err)
243-
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
244-
}
245-
// response from `ShowAppByName`: SingleAppResult
246-
fmt.Fprintf(os.Stdout, "Response from `AppAPI.ShowAppByName`: %v\n", resp)
236+
moduleName := "moduleName_example" // string | The name of the module to retrieve
237+
238+
configuration := openapiclient.NewConfiguration()
239+
apiClient := openapiclient.NewAPIClient(configuration)
240+
resp, r, err := apiClient.AppAPI.ShowAppByName(context.Background(), moduleName).Execute()
241+
if err != nil {
242+
fmt.Fprintf(os.Stderr, "Error when calling `AppAPI.ShowAppByName``: %v\n", err)
243+
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
244+
}
245+
// response from `ShowAppByName`: SingleAppResult
246+
fmt.Fprintf(os.Stdout, "Response from `AppAPI.ShowAppByName`: %v\n", resp)
247247
}
248248
```
249249

0 commit comments

Comments
 (0)