create method

Future<Site> create(
  1. Site request,
  2. String parent, {
  3. String? siteId,
  4. String? $fields,
})

Creates a new Hosting Site in the specified parent Firebase project.

Note that Hosting sites can take several minutes to propagate through Firebase systems.

request - The metadata request object.

Request parameters:

parent - Required. The Firebase project in which to create a Hosting site, in the format: projects/PROJECT_IDENTIFIER Refer to the Site [name](../projects#Site.FIELDS.name) field for details about PROJECT_IDENTIFIER values. Value must have pattern ^projects/\[^/\]+$.

siteId - Required. Immutable. A globally unique identifier for the Hosting site. This identifier is used to construct the Firebase-provisioned subdomains for the site, so it must also be a valid domain name label.

$fields - Selector specifying which fields to include in a partial response.

Completes with a Site.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<Site> create(
  Site request,
  core.String parent, {
  core.String? siteId,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (siteId != null) 'siteId': [siteId],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1beta1/' + core.Uri.encodeFull('$parent') + '/sites';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return Site.fromJson(response_ as core.Map<core.String, core.dynamic>);
}