Skip to content

Latest commit

 

History

History
208 lines (135 loc) · 5.34 KB

File metadata and controls

208 lines (135 loc) · 5.34 KB

\SettingsAPI

All URIs are relative to http://localhost/api

Method HTTP request Description
GetSetting Get /settings/{settingID} Get a setting
GetSettings Get /settings Get all settings
UpdateSetting Put /settings/{settingID} Update a setting

GetSetting

GetSetting200Response GetSetting(ctx, settingID).Execute()

Get a setting

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/sander0542/nginxproxymanager-go"
)

func main() {
	settingID := "default-site" // string | Setting ID

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SettingsAPI.GetSetting(context.Background(), settingID).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SettingsAPI.GetSetting``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSetting`: GetSetting200Response
	fmt.Fprintf(os.Stdout, "Response from `SettingsAPI.GetSetting`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
settingID string Setting ID

Other Parameters

Other parameters are passed through a pointer to a apiGetSettingRequest struct via the builder pattern

Name Type Description Notes

Return type

GetSetting200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSettings

[]GetSettings200ResponseInner GetSettings(ctx).Execute()

Get all settings

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/sander0542/nginxproxymanager-go"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SettingsAPI.GetSettings(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SettingsAPI.GetSettings``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSettings`: []GetSettings200ResponseInner
	fmt.Fprintf(os.Stdout, "Response from `SettingsAPI.GetSettings`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetSettingsRequest struct via the builder pattern

Return type

[]GetSettings200ResponseInner

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateSetting

GetSetting200Response UpdateSetting(ctx, settingID).UpdateSettingRequest(updateSettingRequest).Execute()

Update a setting

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/sander0542/nginxproxymanager-go"
)

func main() {
	settingID := "default-site" // string | Setting ID
	updateSettingRequest := *openapiclient.NewUpdateSettingRequest() // UpdateSettingRequest | Setting Payload

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SettingsAPI.UpdateSetting(context.Background(), settingID).UpdateSettingRequest(updateSettingRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SettingsAPI.UpdateSetting``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateSetting`: GetSetting200Response
	fmt.Fprintf(os.Stdout, "Response from `SettingsAPI.UpdateSetting`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
settingID string Setting ID

Other Parameters

Other parameters are passed through a pointer to a apiUpdateSettingRequest struct via the builder pattern

Name Type Description Notes

updateSettingRequest | UpdateSettingRequest | Setting Payload |

Return type

GetSetting200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]