// SetAddress sets the Address field's value.
183392
func (s *CreateAddressInput) SetAddress(v *Address) *CreateAddressInput {
	s.Address = v
	return s
}
389724
func (s *ClusterMetadata) SetAddressId(v string) *ClusterMetadata {
	s.AddressId = &v
	return s
}
988114
func (s *Device) SetMacAddress(v string) *Device {
	s.MacAddress = &v
	return s
}
1357509
func (s *NewTransitVirtualInterface) SetAmazonAddress(v string) *NewTransitVirtualInterface {
	s.AmazonAddress = &v
	return s
}
306045
func (s *Workspace) SetIpAddress(v string) *Workspace {
	s.IpAddress = &v
	return s
}
892917
func (s *LoadBalancerAddress) SetIpAddress(v string) *LoadBalancerAddress {
	s.IpAddress = &v
	return s
}
940693
func (s *ProfileData) SetAddress(v string) *ProfileData {
	s.Address = &v
	return s
}
421288
func (s *AgentNetworkInfo) SetMacAddress(v string) *AgentNetworkInfo {
	s.MacAddress = &v
	return s
}
435188
func (s *DevEndpoint) SetPrivateAddress(v string) *DevEndpoint {
	s.PrivateAddress = &v
	return s
}
487627
func (s *VirtualInterface) SetAddressFamily(v string) *VirtualInterface {
	s.AddressFamily = &v
	return s
}
1084803
func (s *AgentPreview) SetIpv4Address(v string) *AgentPreview {
	s.Ipv4Address = &v
	return s
}
355033
func (s *CreateClusterInput) SetAddressId(v string) *CreateClusterInput {
	s.AddressId = &v
	return s
}
1223667
func (s *NewTransitVirtualInterfaceAllocation) SetAmazonAddress(v string) *NewTransitVirtualInterfaceAllocation {
	s.AmazonAddress = &v
	return s
}
506716
func (m *Machine) setAddresses(machineAddresses, providerAddresses *[]network.Address) error {
	var (
		machineStateAddresses, providerStateAddresses []address
		newPrivate, newPublic                         *address
		err                                           error
	)
	machine := m
	buildTxn := func(attempt int) ([]txn.Op, error) {
		if attempt != 0 {
			if machine, err = machine.st.Machine(machine.doc.Id); err != nil {
				return nil, err
			}
		}
		var ops []txn.Op
		ops, machineStateAddresses, providerStateAddresses, newPrivate, newPublic, err = machine.setAddressesOps(
			machineAddresses, providerAddresses,
		)
		if err != nil {
			return nil, err
		}
		return ops, nil
	}
	if err := m.st.db().Run(buildTxn); err != nil {
		return errors.Trace(err)
	}

	m.doc.MachineAddresses = machineStateAddresses
	m.doc.Addresses = providerStateAddresses
	if newPrivate != nil {
		oldPrivate := m.doc.PreferredPrivateAddress.networkAddress()
		m.doc.PreferredPrivateAddress = *newPrivate
		logger.Infof(
			"machine %q preferred private address changed from %q to %q",
			m.Id(), oldPrivate, newPrivate.networkAddress(),
		)
	}
	if newPublic != nil {
		oldPublic := m.doc.PreferredPublicAddress.networkAddress()
		m.doc.PreferredPublicAddress = *newPublic
		logger.Infof(
			"machine %q preferred public address changed from %q to %q",
			m.Id(), oldPublic, newPublic.networkAddress(),
		)
	}
	return nil
}
1070242
func (s *BrokerInstance) SetIpAddress(v string) *BrokerInstance {
	s.IpAddress = &v
	return s
}
372847
func (s *ContextDataType) SetIpAddress(v string) *ContextDataType {
	s.IpAddress = &v
	return s
}
1011962
func (s *PrivateIp) SetPrivateIpAddress(v string) *PrivateIp {
	s.PrivateIpAddress = &v
	return s
}