Skip to content

Latest commit

 

History

History
271 lines (169 loc) · 7.84 KB

File metadata and controls

271 lines (169 loc) · 7.84 KB

ProductBrotliCompressionAPI

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
DisableProductBrotliCompression DELETE /enabled-products/v1/brotli_compression/services/{service_id} Disable product
EnableProductBrotliCompression PUT /enabled-products/v1/brotli_compression/services/{service_id} Enable product
GetProductBrotliCompression GET /enabled-products/v1/brotli_compression/services/{service_id} Get product enablement status
GetServicesProductBrotliCompression GET /enabled-products/v1/brotli_compression/services Get services with product enabled

DisableProductBrotliCompression

Disable product

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.ProductBrotliCompressionAPI.DisableProductBrotliCompression(ctx, serviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductBrotliCompressionAPI.DisableProductBrotliCompression`: %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.
serviceId string Alphanumeric string identifying the service.

Other Parameters

Other parameters are passed through a pointer to a apiDisableProductBrotliCompressionRequest 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

EnableProductBrotliCompression

Enable product

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.ProductBrotliCompressionAPI.EnableProductBrotliCompression(ctx, serviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductBrotliCompressionAPI.EnableProductBrotliCompression`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `EnableProductBrotliCompression`: BrotliCompressionResponseBodyEnable
    fmt.Fprintf(os.Stdout, "Response from `ProductBrotliCompressionAPI.EnableProductBrotliCompression`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceId string Alphanumeric string identifying the service.

Other Parameters

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

Name Type Description Notes

Return type

BrotliCompressionResponseBodyEnable

Authorization

API Token

HTTP request headers

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

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

GetProductBrotliCompression

Get product enablement status

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {
    serviceId := "serviceId_example" // string | Alphanumeric string identifying the service.

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.ProductBrotliCompressionAPI.GetProductBrotliCompression(ctx, serviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductBrotliCompressionAPI.GetProductBrotliCompression`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetProductBrotliCompression`: BrotliCompressionResponseBodyEnable
    fmt.Fprintf(os.Stdout, "Response from `ProductBrotliCompressionAPI.GetProductBrotliCompression`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
serviceId string Alphanumeric string identifying the service.

Other Parameters

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

Name Type Description Notes

Return type

BrotliCompressionResponseBodyEnable

Authorization

API Token

HTTP request headers

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

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

GetServicesProductBrotliCompression

Get services with product enabled

Example

package main

import (
    "context"
    "fmt"
    "os"
    "github.com/fastly/fastly-go/fastly"
)

func main() {

    cfg := fastly.NewConfiguration()
    apiClient := fastly.NewAPIClient(cfg)
    ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
    resp, r, err := apiClient.ProductBrotliCompressionAPI.GetServicesProductBrotliCompression(ctx).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductBrotliCompressionAPI.GetServicesProductBrotliCompression`: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetServicesProductBrotliCompression`: BrotliCompressionResponseBodyGetAllServices
    fmt.Fprintf(os.Stdout, "Response from `ProductBrotliCompressionAPI.GetServicesProductBrotliCompression`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

BrotliCompressionResponseBodyGetAllServices

Authorization

API Token

HTTP request headers

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

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