Exemple #1
0
    class Property(messages.Message):
        """A property of a JSON object.

    Fields:
      key: Name of the property.
      value: A JsonValue attribute.
    """
        key = messages.StringField(1)
        value = messages.MessageField(JsonValue, 2)
Exemple #2
0
class ApiUploadInfo(messages.Message):
    """Media upload information for a method.

  Fields:
    accept: (repeated) MIME Media Ranges for acceptable media uploads
        to this method.
    max_size: (integer) Maximum size of a media upload, such as 3MB
        or 1TB (converted to an integer).
    resumable_path: Path to use for resumable uploads.
    resumable_multipart: (boolean) Whether or not the resumable endpoint
        supports multipart uploads.
    simple_path: Path to use for simple uploads.
    simple_multipart: (boolean) Whether or not the simple endpoint
        supports multipart uploads.
  """
    accept = messages.StringField(1, repeated=True)
    max_size = messages.IntegerField(2)
    resumable_path = messages.StringField(3)
    resumable_multipart = messages.BooleanField(4)
    simple_path = messages.StringField(5)
    simple_multipart = messages.BooleanField(6)
Exemple #3
0
class ApiMethodInfo(messages.Message):
    """Configuration info for an API method.

  All fields are strings unless noted otherwise.

  Fields:
    relative_path: Relative path for this method.
    method_id: ID for this method.
    http_method: HTTP verb to use for this method.
    path_params: (repeated) path parameters for this method.
    query_params: (repeated) query parameters for this method.
    ordered_params: (repeated) ordered list of parameters for
        this method.
    description: description of this method.
    request_type_name: name of the request type.
    response_type_name: name of the response type.
    request_field: if not null, the field to pass as the body
        of this POST request. may also be the REQUEST_IS_BODY
        value below to indicate the whole message is the body.
    upload_config: (ApiUploadInfo) Information about the upload
        configuration supported by this method.
    supports_download: (boolean) If True, this method supports
        downloading the request via the `alt=media` query
        parameter.
  """

    relative_path = messages.StringField(1)
    method_id = messages.StringField(2)
    http_method = messages.StringField(3)
    path_params = messages.StringField(4, repeated=True)
    query_params = messages.StringField(5, repeated=True)
    ordered_params = messages.StringField(6, repeated=True)
    description = messages.StringField(7)
    request_type_name = messages.StringField(8)
    response_type_name = messages.StringField(9)
    request_field = messages.StringField(10, default='')
    upload_config = messages.MessageField(ApiUploadInfo, 11)
    supports_download = messages.BooleanField(12, default=False)
Exemple #4
0
class JsonValue(messages.Message):
    """Any valid JSON value."""
    # Is this JSON object `null`?
    is_null = messages.BooleanField(1, default=False)

    # Exactly one of the following is provided if is_null is False; none
    # should be provided if is_null is True.
    boolean_value = messages.BooleanField(2)
    string_value = messages.StringField(3)
    # We keep two numeric fields to keep int64 round-trips exact.
    double_value = messages.FloatField(4, variant=messages.Variant.DOUBLE)
    integer_value = messages.IntegerField(5, variant=messages.Variant.INT64)
    # Compound types
    object_value = messages.MessageField('JsonObject', 6)
    array_value = messages.MessageField('JsonArray', 7)