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

go: Put parameters on separate lines for API methods #1630

Merged
merged 1 commit into from
Jan 10, 2025
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
49 changes: 40 additions & 9 deletions go/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ type ApplicationListOptions struct {
Order *Ordering
}

func (a *Application) List(ctx context.Context, options *ApplicationListOptions) (*ListResponseApplicationOut, error) {
func (a *Application) List(
ctx context.Context,
options *ApplicationListOptions,
) (*ListResponseApplicationOut, error) {
req := a.api.ApplicationAPI.V1ApplicationList(ctx)
if options != nil {
if options.Iterator != nil {
Expand All @@ -39,11 +42,18 @@ func (a *Application) List(ctx context.Context, options *ApplicationListOptions)
return ret, nil
}

func (a *Application) Create(ctx context.Context, applicationIn *ApplicationIn) (*ApplicationOut, error) {
func (a *Application) Create(
ctx context.Context,
applicationIn *ApplicationIn,
) (*ApplicationOut, error) {
return a.CreateWithOptions(ctx, applicationIn, nil)
}

func (a *Application) CreateWithOptions(ctx context.Context, applicationIn *ApplicationIn, options *PostOptions) (*ApplicationOut, error) {
func (a *Application) CreateWithOptions(
ctx context.Context,
applicationIn *ApplicationIn,
options *PostOptions,
) (*ApplicationOut, error) {
req := a.api.ApplicationAPI.V1ApplicationCreate(ctx)
req = req.ApplicationIn(*applicationIn)
if options != nil {
Expand All @@ -58,11 +68,18 @@ func (a *Application) CreateWithOptions(ctx context.Context, applicationIn *Appl
return ret, nil
}

func (a *Application) GetOrCreate(ctx context.Context, applicationIn *ApplicationIn) (*ApplicationOut, error) {
func (a *Application) GetOrCreate(
ctx context.Context,
applicationIn *ApplicationIn,
) (*ApplicationOut, error) {
return a.GetOrCreateWithOptions(ctx, applicationIn, nil)
}

func (a *Application) GetOrCreateWithOptions(ctx context.Context, applicationIn *ApplicationIn, options *PostOptions) (*ApplicationOut, error) {
func (a *Application) GetOrCreateWithOptions(
ctx context.Context,
applicationIn *ApplicationIn,
options *PostOptions,
) (*ApplicationOut, error) {
req := a.api.ApplicationAPI.V1ApplicationCreate(ctx)
req = req.ApplicationIn(*applicationIn)
req = req.GetIfExists(true)
Expand All @@ -78,7 +95,10 @@ func (a *Application) GetOrCreateWithOptions(ctx context.Context, applicationIn
return ret, nil
}

func (a *Application) Get(ctx context.Context, appId string) (*ApplicationOut, error) {
func (a *Application) Get(
ctx context.Context,
appId string,
) (*ApplicationOut, error) {
req := a.api.ApplicationAPI.V1ApplicationGet(ctx, appId)
ret, res, err := req.Execute()
if err != nil {
Expand All @@ -87,7 +107,11 @@ func (a *Application) Get(ctx context.Context, appId string) (*ApplicationOut, e
return ret, nil
}

func (a *Application) Update(ctx context.Context, appId string, applicationIn *ApplicationIn) (*ApplicationOut, error) {
func (a *Application) Update(
ctx context.Context,
appId string,
applicationIn *ApplicationIn,
) (*ApplicationOut, error) {
req := a.api.ApplicationAPI.V1ApplicationUpdate(ctx, appId)
req = req.ApplicationIn(*applicationIn)
ret, res, err := req.Execute()
Expand All @@ -97,7 +121,11 @@ func (a *Application) Update(ctx context.Context, appId string, applicationIn *A
return ret, nil
}

func (a *Application) Patch(ctx context.Context, appId string, applicationPatch *ApplicationPatch) (*ApplicationOut, error) {
func (a *Application) Patch(
ctx context.Context,
appId string,
applicationPatch *ApplicationPatch,
) (*ApplicationOut, error) {
req := a.api.ApplicationAPI.V1ApplicationPatch(ctx, appId)
req = req.ApplicationPatch(*applicationPatch)
ret, res, err := req.Execute()
Expand All @@ -107,7 +135,10 @@ func (a *Application) Patch(ctx context.Context, appId string, applicationPatch
return ret, nil
}

func (a *Application) Delete(ctx context.Context, appId string) error {
func (a *Application) Delete(
ctx context.Context,
appId string,
) error {
req := a.api.ApplicationAPI.V1ApplicationDelete(ctx, appId)
res, err := req.Execute()
return wrapError(err, res)
Expand Down
33 changes: 27 additions & 6 deletions go/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ type Authentication struct {
api *openapi.APIClient
}

func (a *Authentication) AppPortalAccess(ctx context.Context, appId string, appPortalAccessIn *AppPortalAccessIn) (*AppPortalAccessOut, error) {
func (a *Authentication) AppPortalAccess(
ctx context.Context,
appId string,
appPortalAccessIn *AppPortalAccessIn,
) (*AppPortalAccessOut, error) {
return a.AppPortalAccessWithOptions(ctx, appId, appPortalAccessIn, nil)
}

func (a *Authentication) AppPortalAccessWithOptions(ctx context.Context, appId string, appPortalAccessIn *AppPortalAccessIn, options *PostOptions) (*AppPortalAccessOut, error) {
func (a *Authentication) AppPortalAccessWithOptions(
ctx context.Context,
appId string,
appPortalAccessIn *AppPortalAccessIn,
options *PostOptions,
) (*AppPortalAccessOut, error) {
req := a.api.AuthenticationAPI.V1AuthenticationAppPortalAccess(ctx, appId)
req = req.AppPortalAccessIn(*appPortalAccessIn)
if options != nil {
Expand All @@ -29,11 +38,18 @@ func (a *Authentication) AppPortalAccessWithOptions(ctx context.Context, appId s
return ret, nil
}

func (a *Authentication) DashboardAccess(ctx context.Context, appId string) (*DashboardAccessOut, error) {
func (a *Authentication) DashboardAccess(
ctx context.Context,
appId string,
) (*DashboardAccessOut, error) {
return a.DashboardAccessWithOptions(ctx, appId, nil)
}

func (a *Authentication) DashboardAccessWithOptions(ctx context.Context, appId string, options *PostOptions) (*DashboardAccessOut, error) {
func (a *Authentication) DashboardAccessWithOptions(
ctx context.Context,
appId string,
options *PostOptions,
) (*DashboardAccessOut, error) {
req := a.api.AuthenticationAPI.V1AuthenticationDashboardAccess(ctx, appId)
if options != nil {
if options.IdempotencyKey != nil {
Expand All @@ -47,11 +63,16 @@ func (a *Authentication) DashboardAccessWithOptions(ctx context.Context, appId s
return ret, nil
}

func (a *Authentication) Logout(ctx context.Context) error {
func (a *Authentication) Logout(
ctx context.Context,
) error {
return a.LogoutWithOptions(ctx, nil)
}

func (a *Authentication) LogoutWithOptions(ctx context.Context, options *PostOptions) error {
func (a *Authentication) LogoutWithOptions(
ctx context.Context,
options *PostOptions,
) error {
req := a.api.AuthenticationAPI.V1AuthenticationLogout(ctx)
if options != nil {
if options.IdempotencyKey != nil {
Expand Down
10 changes: 8 additions & 2 deletions go/backgroundtask.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ type BackgroundTaskListOptions struct {
Task *BackgroundTaskType
}

func (a *BackgroundTask) List(ctx context.Context, options *BackgroundTaskListOptions) (*ListResponseBackgroundTaskOut, error) {
func (a *BackgroundTask) List(
ctx context.Context,
options *BackgroundTaskListOptions,
) (*ListResponseBackgroundTaskOut, error) {
req := a.api.BackgroundTasksAPI.ListBackgroundTasks(ctx)
if options != nil {
if options.Iterator != nil {
Expand All @@ -44,7 +47,10 @@ func (a *BackgroundTask) List(ctx context.Context, options *BackgroundTaskListOp
return ret, nil
}

func (a *BackgroundTask) Get(ctx context.Context, taskId string) (*BackgroundTaskOut, error) {
func (a *BackgroundTask) Get(
ctx context.Context,
taskId string,
) (*BackgroundTaskOut, error) {
req := a.api.BackgroundTasksAPI.GetBackgroundTask(ctx, taskId)
ret, res, err := req.Execute()
if err != nil {
Expand Down
Loading