All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| AddANewConsentForAUser | Post /auth/user-consent | Add a new User consent |
| GetAllConsentTemplates | Get /auth/user-consent/templates | Get all consent templates |
| GetAllConsentsForAUser | Get /auth/user-consent | Get Consents for a User |
| GetConsentTemplateByType | Get /auth/user-consent/templates/{consent_type} | Get consent template for a specific type |
| UpdateAConsentActionByType | Patch /auth/user-consent/{consent_type} | Grant or revoke an existing consent |
ConsentActionResponse AddANewConsentForAUser(ctx).Payload(payload).Execute()
Add a new User consent
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
payload := *openapiclient.NewRecordConsentRequest("granted", "auto_top_up") // RecordConsentRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserConsentAPI.AddANewConsentForAUser(context.Background()).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserConsentAPI.AddANewConsentForAUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AddANewConsentForAUser`: ConsentActionResponse
fmt.Fprintf(os.Stdout, "Response from `UserConsentAPI.AddANewConsentForAUser`: %v\n", resp)
}Other parameters are passed through a pointer to a apiAddANewConsentForAUserRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| payload | RecordConsentRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConsentTemplatesResponse GetAllConsentTemplates(ctx).Execute()
Get all consent templates
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserConsentAPI.GetAllConsentTemplates(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserConsentAPI.GetAllConsentTemplates``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAllConsentTemplates`: ConsentTemplatesResponse
fmt.Fprintf(os.Stdout, "Response from `UserConsentAPI.GetAllConsentTemplates`: %v\n", resp)
}This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetAllConsentTemplatesRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserConsentsResponse GetAllConsentsForAUser(ctx).ConsentType(consentType).Execute()
Get Consents for a User
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
consentType := "consentType_example" // string | Filter by consent type (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserConsentAPI.GetAllConsentsForAUser(context.Background()).ConsentType(consentType).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserConsentAPI.GetAllConsentsForAUser``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetAllConsentsForAUser`: UserConsentsResponse
fmt.Fprintf(os.Stdout, "Response from `UserConsentAPI.GetAllConsentsForAUser`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetAllConsentsForAUserRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| consentType | string | Filter by consent type |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConsentTemplate GetConsentTemplateByType(ctx, consentType).Execute()
Get consent template for a specific type
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
consentType := "consentType_example" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserConsentAPI.GetConsentTemplateByType(context.Background(), consentType).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserConsentAPI.GetConsentTemplateByType``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetConsentTemplateByType`: ConsentTemplate
fmt.Fprintf(os.Stdout, "Response from `UserConsentAPI.GetConsentTemplateByType`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| consentType | string |
Other parameters are passed through a pointer to a apiGetConsentTemplateByTypeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ConsentActionResponse UpdateAConsentActionByType(ctx, consentType).Payload(payload).Execute()
Grant or revoke an existing consent
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)
func main() {
consentType := "consentType_example" // string |
payload := *openapiclient.NewUpdateConsentRequest("granted") // UpdateConsentRequest |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UserConsentAPI.UpdateAConsentActionByType(context.Background(), consentType).Payload(payload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UserConsentAPI.UpdateAConsentActionByType``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateAConsentActionByType`: ConsentActionResponse
fmt.Fprintf(os.Stdout, "Response from `UserConsentAPI.UpdateAConsentActionByType`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| consentType | string |
Other parameters are passed through a pointer to a apiUpdateAConsentActionByTypeRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
payload | UpdateConsentRequest | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]