// DeriveAvailabilityZones is part of the common.ZonedEnviron interface.
968943
func (env *environ) DeriveAvailabilityZones(ctx context.ProviderCallContext, args environs.StartInstanceParams) (names []string, err error) {
	err = env.withSession(ctx, func(env *sessionEnviron) error {
		names, err = env.DeriveAvailabilityZones(ctx, args)
		return err
	})
	return names, err
}
969178
func (s *InstanceEntry) SetAvailabilityZone(v string) *InstanceEntry {
	s.AvailabilityZone = &v
	return s
}
1191951
func (o *OracleEnviron) InstanceAvailabilityZoneNames(ctx context.ProviderCallContext, ids []instance.Id) ([]string, error) {
	instances, err := o.Instances(ctx, ids)
	if err != nil && err != environs.ErrPartialInstances {
		return nil, err
	}
	zones := make([]string, len(instances))
	for idx := range instances {
		zones[idx] = "default"
	}
	return zones, nil
}
575063
func (s *DBCluster) SetAvailabilityZones(v []*string) *DBCluster {
	s.AvailabilityZones = v
	return s
}
1111004
func (env *environ) InstanceAvailabilityZoneNames(
	ctx context.ProviderCallContext, ids []instance.Id,
) ([]string, error) {
	instances, err := env.Instances(ctx, ids)
	if err != nil && err != environs.ErrPartialInstances {
		return nil, err
	}

	// If not clustered, just report all input IDs as being in the zone
	// represented by the single server.
	server := env.server()
	if !server.IsClustered() {
		zones := make([]string, len(ids))
		n := server.Name()
		for i := range zones {
			zones[i] = n
		}
		return zones, nil
	}

	zones := make([]string, len(instances))
	for i, ins := range instances {
		if ei, ok := ins.(*environInstance); ok {
			zones[i] = ei.container.Location
		}
	}
	return zones, nil
}
1172050
func (s *UpdateAutoScalingGroupInput) SetAvailabilityZones(v []*string) *UpdateAutoScalingGroupInput {
	s.AvailabilityZones = v
	return s
}
149191
func (s *InstanceDetails) SetAvailabilityZone(v string) *InstanceDetails {
	s.AvailabilityZone = &v
	return s
}
1095723
func (s *EnableAvailabilityZonesForLoadBalancerInput) SetAvailabilityZones(v []*string) *EnableAvailabilityZonesForLoadBalancerInput {
	s.AvailabilityZones = v
	return s
}
376243
func (s *NodeSummary) SetAvailabilityZone(v string) *NodeSummary {
	s.AvailabilityZone = &v
	return s
}
341627
func (s *PlacementType) SetAvailabilityZone(v string) *PlacementType {
	s.AvailabilityZone = &v
	return s
}
1244364
func (env *maasEnviron) InstanceAvailabilityZoneNames(ctx context.ProviderCallContext, ids []instance.Id) ([]string, error) {
	instances, err := env.Instances(ctx, ids)
	if err != nil && err != environs.ErrPartialInstances {
		return nil, err
	}
	zones := make([]string, len(instances))
	for i, inst := range instances {
		if inst == nil {
			continue
		}
		z, err := inst.(maasInstance).zone()
		if err != nil {
			logger.Errorf("could not get availability zone %v", err)
			continue
		}
		zones[i] = z
	}
	return zones, nil
}
1250872
func (s *ElasticLoadBalancer) SetAvailabilityZones(v []*string) *ElasticLoadBalancer {
	s.AvailabilityZones = v
	return s
}
262776
func (e *environ) DeriveAvailabilityZones(ctx context.ProviderCallContext, args environs.StartInstanceParams) ([]string, error) {
	availabilityZone, err := e.deriveAvailabilityZone(ctx, args)
	if availabilityZone != "" {
		return []string{availabilityZone}, errors.Trace(err)
	}
	return nil, errors.Trace(err)
}
26972
func (s *OrderableReplicationInstance) SetAvailabilityZones(v []*string) *OrderableReplicationInstance {
	s.AvailabilityZones = v
	return s
}
44013
func (s *RaidArray) SetAvailabilityZone(v string) *RaidArray {
	s.AvailabilityZone = &v
	return s
}
101280
func (e *Environ) InstanceAvailabilityZoneNames(ctx envcontext.ProviderCallContext, ids []instance.Id) ([]string, error) {
	instances, err := e.Instances(ctx, ids)
	if err != nil && err != environs.ErrPartialInstances {
		providerCommon.HandleCredentialError(err, ctx)
		return nil, err
	}
	zones := []string{}
	for _, inst := range instances {
		oInst := inst.(*ociInstance)
		zones = append(zones, oInst.availabilityZone())
	}
	if len(zones) < len(ids) {
		return zones, environs.ErrPartialInstances
	}
	return zones, nil
}
1068995
func (s *TraceSummary) SetAvailabilityZones(v []*AvailabilityZoneDetail) *TraceSummary {
	s.AvailabilityZones = v
	return s
}