pullzone_set_force_ssl.go raw

   1  package bunny
   2  
   3  import (
   4  	"context"
   5  	"fmt"
   6  )
   7  
   8  // SetForceSSLOptions represents the message is to the Set Force SSL Endpoint.
   9  //
  10  // Bunny.net API docs: https://docs.bunny.net/reference/pullzonepublic_setforcessl
  11  type SetForceSSLOptions struct {
  12  	Hostname *string `json:"Hostname,omitempty"`
  13  	ForceSSL *bool   `json:"ForceSSL,omitempty"`
  14  }
  15  
  16  // SetForceSSL enables or disables the force SSL option for a hostname of a Pull Zone.
  17  //
  18  // Bunny.net API docs: https://docs.bunny.net/reference/pullzonepublic_setforcessl
  19  func (s *PullZoneService) SetForceSSL(ctx context.Context, pullzoneID int64, opts *SetForceSSLOptions) error {
  20  	path := fmt.Sprintf("pullzone/%d/setForceSSL", pullzoneID)
  21  	return resourcePost(ctx, s.client, path, opts)
  22  }
  23