github.com/containers/podman/v4@v4.9.4/pkg/bindings/network/types_create_options.go (about)

     1  // Code generated by go generate; DO NOT EDIT.
     2  package network
     3  
     4  import (
     5  	"net"
     6  	"net/url"
     7  
     8  	"github.com/containers/podman/v4/pkg/bindings/internal/util"
     9  )
    10  
    11  // Changed returns true if named field has been set
    12  func (o *CreateOptions) Changed(fieldName string) bool {
    13  	return util.Changed(o, fieldName)
    14  }
    15  
    16  // ToParams formats struct fields to be passed to API service
    17  func (o *CreateOptions) ToParams() (url.Values, error) {
    18  	return util.ToParams(o)
    19  }
    20  
    21  // WithDisableDNS set field DisableDNS to given value
    22  func (o *CreateOptions) WithDisableDNS(value bool) *CreateOptions {
    23  	o.DisableDNS = &value
    24  	return o
    25  }
    26  
    27  // GetDisableDNS returns value of field DisableDNS
    28  func (o *CreateOptions) GetDisableDNS() bool {
    29  	if o.DisableDNS == nil {
    30  		var z bool
    31  		return z
    32  	}
    33  	return *o.DisableDNS
    34  }
    35  
    36  // WithDriver set field Driver to given value
    37  func (o *CreateOptions) WithDriver(value string) *CreateOptions {
    38  	o.Driver = &value
    39  	return o
    40  }
    41  
    42  // GetDriver returns value of field Driver
    43  func (o *CreateOptions) GetDriver() string {
    44  	if o.Driver == nil {
    45  		var z string
    46  		return z
    47  	}
    48  	return *o.Driver
    49  }
    50  
    51  // WithGateway set field Gateway to given value
    52  func (o *CreateOptions) WithGateway(value net.IP) *CreateOptions {
    53  	o.Gateway = &value
    54  	return o
    55  }
    56  
    57  // GetGateway returns value of field Gateway
    58  func (o *CreateOptions) GetGateway() net.IP {
    59  	if o.Gateway == nil {
    60  		var z net.IP
    61  		return z
    62  	}
    63  	return *o.Gateway
    64  }
    65  
    66  // WithInternal set field Internal to given value
    67  func (o *CreateOptions) WithInternal(value bool) *CreateOptions {
    68  	o.Internal = &value
    69  	return o
    70  }
    71  
    72  // GetInternal returns value of field Internal
    73  func (o *CreateOptions) GetInternal() bool {
    74  	if o.Internal == nil {
    75  		var z bool
    76  		return z
    77  	}
    78  	return *o.Internal
    79  }
    80  
    81  // WithLabels set field Labels to given value
    82  func (o *CreateOptions) WithLabels(value map[string]string) *CreateOptions {
    83  	o.Labels = value
    84  	return o
    85  }
    86  
    87  // GetLabels returns value of field Labels
    88  func (o *CreateOptions) GetLabels() map[string]string {
    89  	if o.Labels == nil {
    90  		var z map[string]string
    91  		return z
    92  	}
    93  	return o.Labels
    94  }
    95  
    96  // WithMacVLAN set field MacVLAN to given value
    97  func (o *CreateOptions) WithMacVLAN(value string) *CreateOptions {
    98  	o.MacVLAN = &value
    99  	return o
   100  }
   101  
   102  // GetMacVLAN returns value of field MacVLAN
   103  func (o *CreateOptions) GetMacVLAN() string {
   104  	if o.MacVLAN == nil {
   105  		var z string
   106  		return z
   107  	}
   108  	return *o.MacVLAN
   109  }
   110  
   111  // WithIPRange set field IPRange to given value
   112  func (o *CreateOptions) WithIPRange(value net.IPNet) *CreateOptions {
   113  	o.IPRange = &value
   114  	return o
   115  }
   116  
   117  // GetIPRange returns value of field IPRange
   118  func (o *CreateOptions) GetIPRange() net.IPNet {
   119  	if o.IPRange == nil {
   120  		var z net.IPNet
   121  		return z
   122  	}
   123  	return *o.IPRange
   124  }
   125  
   126  // WithSubnet set field Subnet to given value
   127  func (o *CreateOptions) WithSubnet(value net.IPNet) *CreateOptions {
   128  	o.Subnet = &value
   129  	return o
   130  }
   131  
   132  // GetSubnet returns value of field Subnet
   133  func (o *CreateOptions) GetSubnet() net.IPNet {
   134  	if o.Subnet == nil {
   135  		var z net.IPNet
   136  		return z
   137  	}
   138  	return *o.Subnet
   139  }
   140  
   141  // WithIPv6 set field IPv6 to given value
   142  func (o *CreateOptions) WithIPv6(value bool) *CreateOptions {
   143  	o.IPv6 = &value
   144  	return o
   145  }
   146  
   147  // GetIPv6 returns value of field IPv6
   148  func (o *CreateOptions) GetIPv6() bool {
   149  	if o.IPv6 == nil {
   150  		var z bool
   151  		return z
   152  	}
   153  	return *o.IPv6
   154  }
   155  
   156  // WithOptions set field Options to given value
   157  func (o *CreateOptions) WithOptions(value map[string]string) *CreateOptions {
   158  	o.Options = value
   159  	return o
   160  }
   161  
   162  // GetOptions returns value of field Options
   163  func (o *CreateOptions) GetOptions() map[string]string {
   164  	if o.Options == nil {
   165  		var z map[string]string
   166  		return z
   167  	}
   168  	return o.Options
   169  }
   170  
   171  // WithName set field Name to given value
   172  func (o *CreateOptions) WithName(value string) *CreateOptions {
   173  	o.Name = &value
   174  	return o
   175  }
   176  
   177  // GetName returns value of field Name
   178  func (o *CreateOptions) GetName() string {
   179  	if o.Name == nil {
   180  		var z string
   181  		return z
   182  	}
   183  	return *o.Name
   184  }