Method | HTTP request | Description |
---|---|---|
CreateTenant | Post /v1/tenants | Create tenant |
DeleteTenant | Delete /v1/tenants/{tenantId} | Delete tenant |
GetTenant | Get /v1/tenants/{tenantId} | Retrieve tenant |
GetTenants | Get /v1/tenants | List tenants |
UpdateTenant | Put /v1/tenants/{tenantId} | Update tenant |
Tenant CreateTenant(ctx).Tenant(tenant).Execute()
Create tenant
package main
import (
"context"
"fmt"
"os"
authress "github.com/authress/authress-sdk.go"
)
func main() {
tenant := *authress.NewTenant() // Tenant |
url, _ := url.Parse("https://authress.company.com")
authressClient := authress.NewAuthressClient(authress.AuthressSettings{
AuthressApiUrl: url,
})
resp, r, err := apiClient.Tenants.CreateTenant(context.Background()).Tenant(tenant).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Tenants.CreateTenant``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateTenant`: Tenant
fmt.Fprintf(os.Stdout, "Response from `Tenants.CreateTenant`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateTenantRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
tenant | Tenant |
- Content-Type: application/json
- Accept: application/links+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteTenant(ctx, tenantId).Execute()
Delete tenant
package main
import (
"context"
"fmt"
"os"
authress "github.com/authress/authress-sdk.go"
)
func main() {
tenantId := TODO // TenantId | The tenantId.
url, _ := url.Parse("https://authress.company.com")
authressClient := authress.NewAuthressClient(authress.AuthressSettings{
AuthressApiUrl: url,
})
r, err := apiClient.Tenants.DeleteTenant(context.Background(), tenantId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Tenants.DeleteTenant``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
tenantId | TenantId | The tenantId. |
Other parameters are passed through a pointer to a apiDeleteTenantRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Tenant GetTenant(ctx, tenantId).Execute()
Retrieve tenant
package main
import (
"context"
"fmt"
"os"
authress "github.com/authress/authress-sdk.go"
)
func main() {
tenantId := TODO // TenantId | The tenantId.
url, _ := url.Parse("https://authress.company.com")
authressClient := authress.NewAuthressClient(authress.AuthressSettings{
AuthressApiUrl: url,
})
resp, r, err := apiClient.Tenants.GetTenant(context.Background(), tenantId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Tenants.GetTenant``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTenant`: Tenant
fmt.Fprintf(os.Stdout, "Response from `Tenants.GetTenant`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
tenantId | TenantId | The tenantId. |
Other parameters are passed through a pointer to a apiGetTenantRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/links+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TenantCollection GetTenants(ctx).Execute()
List tenants
package main
import (
"context"
"fmt"
"os"
authress "github.com/authress/authress-sdk.go"
)
func main() {
url, _ := url.Parse("https://authress.company.com")
authressClient := authress.NewAuthressClient(authress.AuthressSettings{
AuthressApiUrl: url,
})
resp, r, err := apiClient.Tenants.GetTenants(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Tenants.GetTenants``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTenants`: TenantCollection
fmt.Fprintf(os.Stdout, "Response from `Tenants.GetTenants`: %v\n", resp)
}
This endpoint does not need any parameter.
Other parameters are passed through a pointer to a apiGetTenantsRequest struct via the builder pattern
- Content-Type: Not defined
- Accept: application/links+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Tenant UpdateTenant(ctx, tenantId).Tenant(tenant).Execute()
Update tenant
package main
import (
"context"
"fmt"
"os"
authress "github.com/authress/authress-sdk.go"
)
func main() {
tenantId := TODO // TenantId | The tenantId.
tenant := *authress.NewTenant() // Tenant |
url, _ := url.Parse("https://authress.company.com")
authressClient := authress.NewAuthressClient(authress.AuthressSettings{
AuthressApiUrl: url,
})
resp, r, err := apiClient.Tenants.UpdateTenant(context.Background(), tenantId).Tenant(tenant).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `Tenants.UpdateTenant``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateTenant`: Tenant
fmt.Fprintf(os.Stdout, "Response from `Tenants.UpdateTenant`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
tenantId | TenantId | The tenantId. |
Other parameters are passed through a pointer to a apiUpdateTenantRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
tenant | Tenant | |
- Content-Type: application/json
- Accept: application/links+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]