# Google Proximity Beacon API . beacons . attachments

## Instance Methods

Deletes multiple attachments on a given beacon. This operation is permanent and cannot be undone. You can optionally specify `namespacedType` to choose which attachments should be deleted. If you do not specify `namespacedType`, all your attachments on the given beacon will be deleted. You also may explicitly specify `*/*` to delete all.

Associates the given data with the specified beacon. Attachment data must contain two parts:

Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone.

Returns the attachments for the specified beacon that match the specified namespaced-type pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use `*/*`, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint.

### Method Details

`batchDelete(beaconName, namespacedType=None, x__xgafv=None)`

    Deletes multiple attachments on a given beacon. This operation is permanent and cannot be undone. You can optionally specify `namespacedType` to choose which attachments should be deleted. If you do not specify `namespacedType`, all your attachments on the given beacon will be deleted. You also may explicitly specify `*/*` to delete all.

    Args:
      beaconName: string, The beacon whose attachments are to be deleted. Required. (required)
      namespacedType: string, Specifies the namespace and type of attachments to delete in `namespace/type` format. Accepts `*/*` to specify "all types in all namespaces". Optional.
      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # Response for a request to delete attachments.
        "numDeleted": 42, # The number of attachments that were deleted.
      }

`create(beaconName, body, x__xgafv=None)`

    Associates the given data with the specified beacon. Attachment data must contain two parts:
    - A namespaced type.
    - The actual attachment data itself.  The namespaced type consists of two parts, the namespace and the type. The namespace must be one of the values returned by the `namespaces` endpoint, while the type can be a string of any characters except for the forward slash (`/`) up to 100 characters in length. Attachment data can be up to 1024 bytes long.

    Args:
      beaconName: string, The beacon on which the attachment should be created. Required. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # Project-specific data associated with a beacon.
        "data": "A String", # An opaque data container for client-provided data. Must be [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP requests, and will be so encoded (with padding) in responses. Required.
        "attachmentName": "A String", # Resource name of this attachment. Attachment names have the format: beacons/beacon_id/attachments/attachment_id. Leave this empty on creation.
        "namespacedType": "A String", # Specifies what kind of attachment this is. Tells a client how to interpret the `data` field. Format is namespace/type. Namespace provides type separation between clients. Type describes the type of `data`, for use by the client when parsing the `data` field. Required.
      }

      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # Project-specific data associated with a beacon.
          "data": "A String", # An opaque data container for client-provided data. Must be [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP requests, and will be so encoded (with padding) in responses. Required.
          "attachmentName": "A String", # Resource name of this attachment. Attachment names have the format: beacons/beacon_id/attachments/attachment_id. Leave this empty on creation.
          "namespacedType": "A String", # Specifies what kind of attachment this is. Tells a client how to interpret the `data` field. Format is namespace/type. Namespace provides type separation between clients. Type describes the type of `data`, for use by the client when parsing the `data` field. Required.
        }

`delete(attachmentName, x__xgafv=None)`

    Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone.

    Args:
      attachmentName: string, The attachment name (`attachmentName`) of the attachment to remove. For example: `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738` Required. (required)
      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
      }

`list(beaconName, namespacedType=None, x__xgafv=None)`

    Returns the attachments for the specified beacon that match the specified namespaced-type pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use `*/*`, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint.

    Args:
      beaconName: string, The beacon whose attachments are to be fetched. Required. (required)
      namespacedType: string, Specifies the namespace and type of attachment to include in response in namespace/type format. Accepts `*/*` to specify "all types in all namespaces".
      x__xgafv: string, V1 error format.

    Returns:
      An object of the form:

        { # Response to ListBeaconAttachments that contains the requested attachments.
        "attachments": [ # The attachments that corresponded to the request params.
          { # Project-specific data associated with a beacon.
              "data": "A String", # An opaque data container for client-provided data. Must be [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP requests, and will be so encoded (with padding) in responses. Required.
              "attachmentName": "A String", # Resource name of this attachment. Attachment names have the format: beacons/beacon_id/attachments/attachment_id. Leave this empty on creation.
              "namespacedType": "A String", # Specifies what kind of attachment this is. Tells a client how to interpret the `data` field. Format is namespace/type. Namespace provides type separation between clients. Type describes the type of `data`, for use by the client when parsing the `data` field. Required.
            },
        ],
      }