Skip to content

Latest commit

 

History

History
468 lines (295 loc) · 13.9 KB

ServiceAuthorizationsAPI.md

File metadata and controls

468 lines (295 loc) · 13.9 KB

ServiceAuthorizationsAPI

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

CreateServiceAuthorization

Create service authorization

Example

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)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
serviceAuthorization ServiceAuthorization

Return type

ServiceAuthorizationResponse

Authorization

API Token

HTTP request headers

  • Content-Type: application/vnd.api+json
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

DeleteServiceAuthorization

Delete service authorization

Example

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)
    }
}

Path Parameters

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

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

Name Type Description Notes

Return type

(empty response body)

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

Back to top | Back to API list | Back to README

DeleteServiceAuthorization2

Delete service authorizations

Example

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)
}

Path Parameters

Other Parameters

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

Return type

InlineResponse2007

Authorization

API Token

HTTP request headers

  • 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

ListServiceAuthorization

List service authorizations

Example

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)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
pageNumber int32 Current page. pageSize

Return type

ServiceAuthorizationsResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

ShowServiceAuthorization

Show service authorization

Example

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)
}

Path Parameters

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

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

Name Type Description Notes

Return type

ServiceAuthorizationResponse

Authorization

API Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

UpdateServiceAuthorization

Update service authorization

Example

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)
}

Path Parameters

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

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

Name Type Description Notes
serviceAuthorization ServiceAuthorization

Return type

ServiceAuthorizationResponse

Authorization

API Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/vnd.api+json

Back to top | Back to API list | Back to README

UpdateServiceAuthorization2

Update service authorizations

Example

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)
}

Path Parameters

Other Parameters

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

Return type

ServiceAuthorizationsResponse

Authorization

API Token

HTTP request headers

  • 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