// SetHostedZoneId sets the HostedZoneId field's value.
765913
func (s *ListVPCAssociationAuthorizationsInput) SetHostedZoneId(v string) *ListVPCAssociationAuthorizationsInput {
	s.HostedZoneId = &v
	return s
}
555878
func (s *User) SetTimeZoneId(v string) *User {
	s.TimeZoneId = &v
	return s
}
1041109
func (s *ListVPCAssociationAuthorizationsOutput) SetHostedZoneId(v string) *ListVPCAssociationAuthorizationsOutput {
	s.HostedZoneId = &v
	return s
}
42499
func (s *RuleCondition) SetHostHeaderConfig(v *HostHeaderConditionConfig) *RuleCondition {
	s.HostHeaderConfig = v
	return s
}
90152
func (s *UpdateUserInput) SetTimeZoneId(v string) *UpdateUserInput {
	s.TimeZoneId = &v
	return s
}
77947
func (s *CreateHITTypeOutput) SetHITTypeId(v string) *CreateHITTypeOutput {
	s.HITTypeId = &v
	return s
}
586684
func (s *GetHostedZoneCountOutput) SetHostedZoneCount(v int64) *GetHostedZoneCountOutput {
	s.HostedZoneCount = &v
	return s
}
142639
func (s *ChangeResourceRecordSetsInput) SetHostedZoneId(v string) *ChangeResourceRecordSetsInput {
	s.HostedZoneId = &v
	return s
}
266471
func (s *UpdateExpirationForHITInput) SetHITId(v string) *UpdateExpirationForHITInput {
	s.HITId = &v
	return s
}
576683
func (s *LoadBalancer) SetCanonicalHostedZoneId(v string) *LoadBalancer {
	s.CanonicalHostedZoneId = &v
	return s
}
42467
func (s *CreateHostedZoneOutput) SetHostedZone(v *HostedZone) *CreateHostedZoneOutput {
	s.HostedZone = v
	return s
}
1005443
func (s *SearchFacesOutput) SetSearchedFaceId(v string) *SearchFacesOutput {
	s.SearchedFaceId = &v
	return s
}
947244
func (s *ListHostedZonesByNameInput) SetHostedZoneId(v string) *ListHostedZonesByNameInput {
	s.HostedZoneId = &v
	return s
}
570111
func (s *Assignment) SetHITId(v string) *Assignment {
	s.HITId = &v
	return s
}
104872
func (s *DeleteVPCAssociationAuthorizationInput) SetHostedZoneId(v string) *DeleteVPCAssociationAuthorizationInput {
	s.HostedZoneId = &v
	return s
}
1155310
func (s *SamplingRuleUpdate) SetHost(v string) *SamplingRuleUpdate {
	s.Host = &v
	return s
}
455416
func (vm *VM) fillZoneID() error {

	params := url.Values{}
	params.Set("name", strings.ToLower(string(vm.Zone.Name)))

	client := vm.getExoClient()
	resp, err := client.Request("listZones", params)
	if err != nil {
		return fmt.Errorf("Getting zones ID for %q: %s", vm.ServiceOffering.Name, err)
	}

	zones := &egoscale.ListZonesResponse{}
	if err := json.Unmarshal(resp, zones); err != nil {
		return fmt.Errorf("Decoding response for zones list: %s", err)
	}

	for _, zone := range zones.Zones {
		if zone.Name == vm.Zone.Name {
			vm.Zone.ID = zone.Id
			return nil
		}
	}

	return fmt.Errorf("Zone ID for %q could not be found", vm.Zone.Name)
}