Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
CreateServiceAuthorization | POST /service-authorizations |
Create service authorization |
DeleteServiceAuthorization | DELETE /service-authorizations/{service_authorization_id} |
Delete service authorization |
DeleteServiceAuthorization2 | DELETE /service-authorizations |
Delete service authorizations |
ListServiceAuthorization | GET /service-authorizations |
List service authorizations |
ShowServiceAuthorization | GET /service-authorizations/{service_authorization_id} |
Show service authorization |
UpdateServiceAuthorization | PATCH /service-authorizations/{service_authorization_id} |
Update service authorization |
UpdateServiceAuthorization2 | PATCH /service-authorizations |
Update service authorizations |
Create service authorization
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceAuthorization := *openapiclient.NewServiceAuthorization() // ServiceAuthorization | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ServiceAuthorizationsAPI.CreateServiceAuthorization(ctx).ServiceAuthorization(serviceAuthorization).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceAuthorizationsAPI.CreateServiceAuthorization`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateServiceAuthorization`: ServiceAuthorizationResponse
fmt.Fprintf(os.Stdout, "Response from `ServiceAuthorizationsAPI.CreateServiceAuthorization`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateServiceAuthorizationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
serviceAuthorization | ServiceAuthorization |
- Content-Type: application/vnd.api+json
- Accept: application/vnd.api+json
Back to top | Back to API list | Back to README
Delete service authorization
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceAuthorizationID := "serviceAuthorizationId_example" // string | Alphanumeric string identifying a service authorization.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ServiceAuthorizationsAPI.DeleteServiceAuthorization(ctx, serviceAuthorizationID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceAuthorizationsAPI.DeleteServiceAuthorization`: %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. | |
serviceAuthorizationID | string | Alphanumeric string identifying a service authorization. |
Other parameters are passed through a pointer to a apiDeleteServiceAuthorizationRequest 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 README
Delete service authorizations
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ServiceAuthorizationsAPI.DeleteServiceAuthorization2(ctx).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceAuthorizationsAPI.DeleteServiceAuthorization2`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteServiceAuthorization2`: InlineResponse2007
fmt.Fprintf(os.Stdout, "Response from `ServiceAuthorizationsAPI.DeleteServiceAuthorization2`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiDeleteServiceAuthorization2Request struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
requestBody | map[string]map[string]any |
- Content-Type: application/vnd.api+json; ext=bulk
- Accept: application/vnd.api+json; ext=bulk
Back to top | Back to API list | Back to README
List service authorizations
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
pageNumber := int32(1) // int32 | Current page. (optional)
pageSize := int32(20) // int32 | Number of records per page. (optional) (default to 20)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ServiceAuthorizationsAPI.ListServiceAuthorization(ctx).PageNumber(pageNumber).PageSize(pageSize).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceAuthorizationsAPI.ListServiceAuthorization`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListServiceAuthorization`: ServiceAuthorizationsResponse
fmt.Fprintf(os.Stdout, "Response from `ServiceAuthorizationsAPI.ListServiceAuthorization`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListServiceAuthorizationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
pageNumber | int32 | Current page. | pageSize |
- Content-Type: Not defined
- Accept: application/vnd.api+json
Back to top | Back to API list | Back to README
Show service authorization
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceAuthorizationID := "serviceAuthorizationId_example" // string | Alphanumeric string identifying a service authorization.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ServiceAuthorizationsAPI.ShowServiceAuthorization(ctx, serviceAuthorizationID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceAuthorizationsAPI.ShowServiceAuthorization`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ShowServiceAuthorization`: ServiceAuthorizationResponse
fmt.Fprintf(os.Stdout, "Response from `ServiceAuthorizationsAPI.ShowServiceAuthorization`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceAuthorizationID | string | Alphanumeric string identifying a service authorization. |
Other parameters are passed through a pointer to a apiShowServiceAuthorizationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/vnd.api+json
Back to top | Back to API list | Back to README
Update service authorization
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
serviceAuthorizationID := "serviceAuthorizationId_example" // string | Alphanumeric string identifying a service authorization.
serviceAuthorization := *openapiclient.NewServiceAuthorization() // ServiceAuthorization | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ServiceAuthorizationsAPI.UpdateServiceAuthorization(ctx, serviceAuthorizationID).ServiceAuthorization(serviceAuthorization).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceAuthorizationsAPI.UpdateServiceAuthorization`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateServiceAuthorization`: ServiceAuthorizationResponse
fmt.Fprintf(os.Stdout, "Response from `ServiceAuthorizationsAPI.UpdateServiceAuthorization`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
serviceAuthorizationID | string | Alphanumeric string identifying a service authorization. |
Other parameters are passed through a pointer to a apiUpdateServiceAuthorizationRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
serviceAuthorization | ServiceAuthorization |
- Content-Type: application/json
- Accept: application/vnd.api+json
Back to top | Back to API list | Back to README
Update service authorizations
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
requestBody := map[string]map[string]any{"key": map[string]any(123)} // map[string]map[string]any | (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.ServiceAuthorizationsAPI.UpdateServiceAuthorization2(ctx).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ServiceAuthorizationsAPI.UpdateServiceAuthorization2`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateServiceAuthorization2`: ServiceAuthorizationsResponse
fmt.Fprintf(os.Stdout, "Response from `ServiceAuthorizationsAPI.UpdateServiceAuthorization2`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiUpdateServiceAuthorization2Request struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
requestBody | map[string]map[string]any |
- Content-Type: application/vnd.api+json; ext=bulk
- Accept: application/vnd.api+json; ext=bulk