Get all localities linked to a zip code

REST: POST /connectivity/eligibility/search/cities
@param zipCode [required] Zip code
171484
public OvhAsyncTaskArray<OvhCity> eligibility_search_cities_POST(String zipCode) throws IOException {
		String qPath = "/connectivity/eligibility/search/cities";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "zipCode", zipCode);
		String resp = execN(qPath, "POST", sb.toString(), o);
		return convertTo(resp, t4);
	}
454701
async def status_by_zip(self, zip_code: str) -> dict:
        """"""
        try:
            location = next((
                d for d in await self.user_reports()
                if d['zip'] == zip_code))
        except StopIteration:
            return {}

        return await self.status_by_coordinates(
            float(location['latitude']), float(location['longitude']))
610236
def address(self, street, city=None, state=None, zipcode=None, **kwargs):
        ''''''
        fields = {
            'street': street,
            'city': city,
            'state': state,
            'zip': zipcode,
        }

        return self._fetch('address', fields, **kwargs)
275981
public Iterable<DContact> queryByZipCode(Object parent, java.lang.String zipCode) {
    return queryByField(parent, DContactMapper.Field.ZIPCODE.getFieldName(), zipCode);
  }
1079685
def _get_states_from_samecodes(self, geocodes):
        
        states = []
        for code in geocodes:
            if not isinstance(geocodes, list):
                raise Exception("specified geocodes must be list")
            try:
                state = self.samecodes[code]['state']
            except KeyError:
                raise Exception("Samecode Not Found")
            else:
                if state not in states:
                    states.append(state)
        return states
151980
public static PendingResult<ElevationResult[]> getByPoints(
      GeoApiContext context, EncodedPolyline encodedPolyline) {
    return context.get(
        API_CONFIG, MultiResponse.class, "locations", "enc:" + encodedPolyline.getEncodedPath());
  }
290103
function(request){
      // Don't geocode if the requested address is empty
      if (!request.address) {
        return;
      }
      if (this.options.bounds && !request.bounds){
        if (this.options.bounds === true){
          request.bounds = this.map && this.map.getBounds();
        } else {
          request.bounds = this.options.bounds;
        }
      }

      if (this.options.country){
        request.region = this.options.country;
      }

      this.geocoder.geocode(request, $.proxy(this.handleGeocode, this));
    }
301642
public function geocode( $postal_code ) {
    // Setup local variable for holding results from geocoder.
    $addressCollection = null;

    // Try to call the geocoder.
    try {
      // Set it call to geocoder...
      $curl     = new \Ivory\HttpAdapter\CurlHttpAdapter();
      $geocoder = new \Geocoder\Provider\GoogleMaps( $curl, null, null, true );

      // Geocode the zipcode...
      $addressCollection = $geocoder->geocode( $postal_code );
    } catch ( \Exception $exception ) {
      // Recover from exception by rethrowing wrapped in GeocodingException.
      throw new GeocodingException( 'An exception occurred during geocoding.', 0, $exception );
    }

    // Make sure geocode found at least one result.
    if ( ! $addressCollection->has( 0 ) ) {
      throw new GeocodingException( 'ZIP code geocode did not return any results: ' . $postal_code );
    }

    // Store first result in local variable.
    $address = $addressCollection->get( 0 );

    // Return result.
    return new LatLon( $address->getLatitude(), $address->getLongitude() );
  }
664612
@Requires("location != null")
  public List<? extends File> getLocation(Location location) {
    Iterable<? extends File> path = fileManager.getLocation(location);
    if (path == null) {
      return null;
    }

    ArrayList<File> locations = new ArrayList<File>();
    for (File entry : path) {
      locations.add(entry);
    }
    return locations;
  }
482852
public function geocode( $postal_code ) {
    // Validate ZIP code.
    if ( false == static::validate_postal_code( $postal_code ) ) {
      throw new GeocodingException( 'ZIP code value is invalid: ' . $postal_code );
    }

    // Delegate geocoding to underlying provider.
    return $this->getGeocodingProvider()->geocode( $postal_code );
  }
767148
function geocode(address, callback) {
  var query = qs.stringify({ address: address, sensor: false, components: 'country:US' })
    , reqtmpl = "http://maps.googleapis.com/maps/api/geocode/json?%s"
    , req = util.format(reqtmpl, query)
    , geo
    ;
  
  request(req, function(err, res, body) {
    if (err) {
      console.log('ERROR: ' + err);
      return callback(err);
    }

    console.log(body);

    geo = parseGoogleGeocodes(JSON.parse(body));

    if (!geo) {
      return callback("can't determine address");
    } else {
      return callback(null, geo);
    }
  });
}
356823
public OvhAsyncTask<OvhMeetings> eligibility_search_meetings_POST(String eligibilityReference, String productCode) throws IOException {
		String qPath = "/connectivity/eligibility/search/meetings";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "eligibilityReference", eligibilityReference);
		addBody(o, "productCode", productCode);
		String resp = execN(qPath, "POST", sb.toString(), o);
		return convertTo(resp, t6);
	}
230587
public OvhAsyncTaskArray<OvhFiberStreet> eligibility_search_fiberStreets_POST(String inseeCode) throws IOException {
		String qPath = "/xdsl/eligibility/search/fiberStreets";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "inseeCode", inseeCode);
		String resp = execN(qPath, "POST", sb.toString(), o);
		return convertTo(resp, t11);
	}
964664
private static GeocodeApiResponse.Result firstResult(final GeocodeApiResponse apiResponse) {
        if (apiResponse.getStatus() != GeocodeApiResponse.Status.OK) {
            return null;
        }
        final List<GeocodeApiResponse.Result> results = apiResponse.getResults();
        if (results.isEmpty()) {
            return null;
        }
        return results.get(0);
    }
354196
public function setZipCode($zipCode): Hybrid
    {
        self::validateSetLength('zipCode', $zipCode);
        $this->data['zipCode'] = $zipCode;

        return $this;
    }
169178
private static function conversionRoutingCode($zipcode) {
        $number = $zipcode;
        switch (strlen($zipcode)) {
            case 11:
                $number = bcadd($number, '1000000000', 0);
            case 9:
                $number = bcadd($number, '100000', 0);
            case 5:
                $number = bcadd($number, '1', 0);
            default:
                return $number;
        }
    }
1078041
public function suggest($zipcode, $number, $addition = null)
    {
      // Concat url
      $url = self::API_URL . '/suggest?q=' . $zipcode . '-' . $number . (!empty($addition) ? '-' . $addition : '');

      // Create a REST request
      $request = new \LibX\Net\Rest\Request($url, \LibX\Net\Rest\Request::REQUEST_METHOD_GET);

      // Create a REST response
      $response = new \LibX\Net\Rest\Response();

      // Make the call
      $data = $this->call($request, $response);

      if($data->response->numFound > 1)
        throw new Exception('More then one document found');

      // Get document
      $document = array_pop($data->response->docs);

      // Check type
      if($document->type !== 'adres')
        throw new Exception('Invalid document type found (' . $doc->type . ')');

      // Get address id
      $id = $document->id;

      return $id;
    }