Method: inventory.partners.merchants.services.availability.replace

Replaces the Availability of an existing Service of a merchant managed by the specified aggregator, and returns it.

HTTP request

POST https://mapsbooking.googleapis.com/v1alpha/inventory/{serviceAvailability.name=partners/*/merchants/*/services/*}/availability:replace

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
serviceAvailability.name

string

The resource name of the service to apply this to. In the format of partners/{partner_id}/merchants/{merchantId}/services/{serviceId}

Request body

The request body contains data with the following structure:

JSON representation
{
  "serviceAvailability": {
    "name": string,
    "startTimeRestrict": string,
    "endTimeRestrict": string,
    "durationRestrict": string,
    "resourcesRestrict": {
      object (Resources)
    },
    "availability": [
      {
        object (Availability)
      }
    ]
  }
}
Fields
serviceAvailability.startTimeRestrict

string (Timestamp format)

If provided, we will consider the Availability entities provided to be a complete snapshot from [startTimeRestrict, endTimeRestrict). That is, all existing availability will be deleted if the following condition holds true:

   startTimeRestrict <= availability.start_sec &&
   availability.start_sec < endTimeRestrict

If a duration message is set, the condition is further restricted:

  availability.duration == durationRestrict

If a resourcesRestrict message is set, the condition is further restricted:

   availability.resources.staff_id == resourcesRestrict.staff_id &&
   availability.resources.room_id == resourcesRestrict.room_id

These fields are typically used to provide a complete update of availability in a given time range.

Setting startTimeRestrict while leaving endTimeRestrict unset is interpreted to mean all time beginning at startTimeRestrict.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

serviceAvailability.endTimeRestrict

string (Timestamp format)

Setting endTimeRestrict while leaving startTimeRestrict unset is interpreted to mean all time up to the endTimeRestrict.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

serviceAvailability.durationRestrict

string (Duration format)

Setting duration further restricts the scope of the update to just the availability with matching duration.

A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

serviceAvailability.resourcesRestrict

object (Resources)

Setting resourcesRestrict further restricts the scope of the update to just this set of resources. All id fields of the resources must match exactly.

serviceAvailability.availability[]

object (Availability)

The new list of availability.

Response body

If successful, the response body contains data with the following structure:

A list of availability and who/when they should be applied to.

JSON representation
{
  "name": string,
  "startTimeRestrict": string,
  "endTimeRestrict": string,
  "durationRestrict": string,
  "resourcesRestrict": {
    object (Resources)
  },
  "availability": [
    {
      object (Availability)
    }
  ]
}
Fields
name

string

The resource name of the service to apply this to. In the format of partners/{partner_id}/merchants/{merchantId}/services/{serviceId}

startTimeRestrict

string (Timestamp format)

If provided, we will consider the Availability entities provided to be a complete snapshot from [startTimeRestrict, endTimeRestrict). That is, all existing availability will be deleted if the following condition holds true:

   startTimeRestrict <= availability.start_sec &&
   availability.start_sec < endTimeRestrict

If a duration message is set, the condition is further restricted:

  availability.duration == durationRestrict

If a resourcesRestrict message is set, the condition is further restricted:

   availability.resources.staff_id == resourcesRestrict.staff_id &&
   availability.resources.room_id == resourcesRestrict.room_id

These fields are typically used to provide a complete update of availability in a given time range.

Setting startTimeRestrict while leaving endTimeRestrict unset is interpreted to mean all time beginning at startTimeRestrict.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

endTimeRestrict

string (Timestamp format)

Setting endTimeRestrict while leaving startTimeRestrict unset is interpreted to mean all time up to the endTimeRestrict.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

durationRestrict

string (Duration format)

Setting duration further restricts the scope of the update to just the availability with matching duration.

A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

resourcesRestrict

object (Resources)

Setting resourcesRestrict further restricts the scope of the update to just this set of resources. All id fields of the resources must match exactly.

availability[]

object (Availability)

The new list of availability.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/mapsbooking