github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/apigw/dedicated/v2/apigroups/results.go (about)

     1  package apigroups
     2  
     3  import (
     4  	"github.com/chnsz/golangsdk"
     5  	"github.com/chnsz/golangsdk/pagination"
     6  )
     7  
     8  type commonResult struct {
     9  	golangsdk.Result
    10  }
    11  
    12  // CreateResult represents a result of the Create method.
    13  type CreateResult struct {
    14  	commonResult
    15  }
    16  
    17  // GetResult represents a result of the Get operation.
    18  type GetResult struct {
    19  	commonResult
    20  }
    21  
    22  // UpdateResult represents a result of the Update operation.
    23  type UpdateResult struct {
    24  	commonResult
    25  }
    26  
    27  type Group struct {
    28  	// List of independent domain names bound to the API group.
    29  	UrlDomians []UrlDomian `json:"url_domains"`
    30  	// Time when the API group was last modified.
    31  	UpdateTime string `json:"update_time"`
    32  	// API group name.
    33  	Name string `json:"name"`
    34  	// Indicates whether the API group has been listed on the marketplace.
    35  	//     1: listed
    36  	//     2: not listed
    37  	//     3: under review.
    38  	OnSellStatus int `json:"on_sell_status"`
    39  	// Description.
    40  	Description string `json:"remark"`
    41  	// Subdomain name that API Gateway automatically allocates to the API group.
    42  	Subdomain string `json:"sl_domain"`
    43  	// Subdomain names that API Gateway automatically allocates to the API group.
    44  	Subdomains []string `json:"sl_domains"`
    45  	// ID.
    46  	Id string `json:"id"`
    47  	// Registraion time.
    48  	RegistraionTime string `json:"register_time"`
    49  	// group status.
    50  	//     1: valid
    51  	Status int `json:"status"`
    52  	// Indicates whether the API group is the default group.
    53  	IsDefault int `json:"is_default"`
    54  }
    55  
    56  type UrlDomian struct {
    57  	// Domain ID.
    58  	Id string `json:"id"`
    59  	// Domain ID.
    60  	DomainName string `json:"domain"`
    61  	// CNAME resolution status of the domain name.
    62  	//     1: not resolved
    63  	//     2: resolving
    64  	//     3: resolved
    65  	//     4: resolving failed
    66  	ResolutionStatus int `json:"cname_status"`
    67  	// SSL certificate ID.
    68  	SSLId string `json:"ssl_id"`
    69  	// SSL certificate name.
    70  	SSLName string `json:"ssl_name"`
    71  	// Minimum SSL version. TLS 1.1 and TLS 1.2 are supported.
    72  	// Enumeration values:
    73  	//     TLSv1.1
    74  	//     TLSv1.2
    75  	MinSSLVersion string `json:"min_ssl_version"`
    76  	// Whether to enable redirection from HTTP to HTTPS.
    77  	IsHttpRedirectToHttps bool `json:"is_http_redirect_to_https"`
    78  }
    79  
    80  func (r commonResult) Extract() (*Group, error) {
    81  	var s Group
    82  	err := r.ExtractInto(&s)
    83  	return &s, err
    84  }
    85  
    86  // GroupPage represents the response pages of the List operation.
    87  type GroupPage struct {
    88  	pagination.SinglePageBase
    89  }
    90  
    91  func ExtractGroups(r pagination.Page) ([]Group, error) {
    92  	var s []Group
    93  	err := r.(GroupPage).Result.ExtractIntoSlicePtr(&s, "groups")
    94  	return s, err
    95  }
    96  
    97  // DeleteResult represents a result of the Delete method.
    98  type DeleteResult struct {
    99  	golangsdk.ErrResult
   100  }
   101  
   102  // AssociateDoaminResp is the structure that represents the API response of AssociateDomain method request.
   103  type AssociateDoaminResp struct {
   104  	// Domain ID.
   105  	ID string `json:"id"`
   106  	// Custom domain name.
   107  	UrlDoamin string `json:"url_domain"`
   108  	// CNAME resolution status of the domain name.
   109  	// + 1: not resolved
   110  	// + 2: resolving
   111  	// + 3: resolved
   112  	// + 4: resolving failed
   113  	Status int `json:"status"`
   114  	// The minimum SSL version supported.
   115  	MinSSLVersion string `json:"min_ssl_version"`
   116  	// Whether to enable redirection from HTTP to HTTPS.
   117  	IsHttpRedirectToHttps bool `json:"is_http_redirect_to_https"`
   118  	// Whether to enable client certificate verification.
   119  	VerifiedClientCertificateEnabled bool `json:"verified_client_certificate_enabled"`
   120  }