github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/networking/v2/extensions/snatrules/results.go (about)

     1  package snatrules
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  // SnatRule is a struct that represents a snat rule
     8  type SnatRule struct {
     9  	ID                string `json:"id"`
    10  	NatGatewayID      string `json:"nat_gateway_id"`
    11  	NetworkID         string `json:"network_id"`
    12  	TenantID          string `json:"tenant_id"`
    13  	FloatingIPID      string `json:"floating_ip_id"`
    14  	FloatingIPAddress string `json:"floating_ip_address"`
    15  	Status            string `json:"status"`
    16  	AdminStateUp      bool   `json:"admin_state_up"`
    17  	Cidr              string `json:"cidr"`
    18  	SourceType        string `json:"source_type"`
    19  }
    20  
    21  // GetResult is a return struct of get method
    22  type GetResult struct {
    23  	golangsdk.Result
    24  }
    25  
    26  func (r GetResult) Extract() (SnatRule, error) {
    27  	var SR SnatRule
    28  	err := r.Result.ExtractIntoStructPtr(&SR, "snat_rule")
    29  	return SR, err
    30  }
    31  
    32  // CreateResult is a return struct of create method
    33  type CreateResult struct {
    34  	golangsdk.Result
    35  }
    36  
    37  func (r CreateResult) Extract() (SnatRule, error) {
    38  	var SR SnatRule
    39  	err := r.Result.ExtractIntoStructPtr(&SR, "snat_rule")
    40  	return SR, err
    41  }
    42  
    43  // DeleteResult is a return struct of delete method
    44  type DeleteResult struct {
    45  	golangsdk.ErrResult
    46  }