github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/networking/v2/extensions/hw_snatrules/results.go (about)

     1  package hw_snatrules
     2  
     3  import (
     4  	"github.com/chnsz/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  	Description       string `json:"description"`
    16  	Status            string `json:"status"`
    17  	AdminStateUp      bool   `json:"admin_state_up"`
    18  	Cidr              string `json:"cidr"`
    19  	SourceType        int    `json:"source_type"`
    20  }
    21  
    22  type commonResult struct {
    23  	golangsdk.Result
    24  }
    25  
    26  func (r commonResult) 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  	commonResult
    35  }
    36  
    37  // UpdateResult is a return struct of update method
    38  type UpdateResult struct {
    39  	commonResult
    40  }
    41  
    42  // GetResult is a return struct of get method
    43  type GetResult struct {
    44  	commonResult
    45  }
    46  
    47  // DeleteResult is a return struct of delete method
    48  type DeleteResult struct {
    49  	golangsdk.ErrResult
    50  }