Admin SDK API . schemas

Instance Methods

close()

Close httplib2 connections.

delete(customerId, schemaKey, x__xgafv=None)

Deletes a schema.

get(customerId, schemaKey, x__xgafv=None)

Retrieves a schema.

insert(customerId, body=None, x__xgafv=None)

Creates a schema.

list(customerId, x__xgafv=None)

Retrieves all schemas for a customer.

patch(customerId, schemaKey, body=None, x__xgafv=None)

Patches a schema.

update(customerId, schemaKey, body=None, x__xgafv=None)

Updates a schema.

Method Details

close()
Close httplib2 connections.
delete(customerId, schemaKey, x__xgafv=None)
Deletes a schema.

Args:
  customerId: string, Immutable ID of the Google Workspace account. (required)
  schemaKey: string, Name or immutable ID of the schema. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
get(customerId, schemaKey, x__xgafv=None)
Retrieves a schema.

Args:
  customerId: string, Immutable ID of the Google Workspace account. (required)
  schemaKey: string, Name or immutable ID of the schema. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The type of API resource. For Schema resources, this is always `admin#directory#schema`.
  "displayName": "A String", # Display name for the schema.
  "etag": "A String", # The ETag of the resource.
  "fields": [ # A list of fields in the schema.
    { # You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see [Custom User Fields](/admin-sdk/directory/v1/guides/manage-schemas).
      "displayName": "A String", # Display Name of the field.
      "etag": "A String", # The ETag of the field.
      "fieldId": "A String", # The unique identifier of the field (Read-only)
      "fieldName": "A String", # The name of the field.
      "fieldType": "A String", # The type of the field.
      "indexed": true, # Boolean specifying whether the field is indexed or not. Default: `true`.
      "kind": "admin#directory#schema#fieldspec", # The kind of resource this is. For schema fields this is always `admin#directory#schema#fieldspec`.
      "multiValued": True or False, # A boolean specifying whether this is a multi-valued field or not. Default: `false`.
      "numericIndexingSpec": { # Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the `numericIndexingSpec` allows range queries to be supported.
        "maxValue": 3.14, # Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
        "minValue": 3.14, # Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
      },
      "readAccessType": "ALL_DOMAIN_USERS", # Specifies who can view values of this field. See [Retrieve users as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) for more information. Note: It may take up to 24 hours for changes to this field to be reflected.
    },
  ],
  "kind": "admin#directory#schema", # Kind of resource this is.
  "schemaId": "A String", # The unique identifier of the schema (Read-only)
  "schemaName": "A String", # The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
}
insert(customerId, body=None, x__xgafv=None)
Creates a schema.

Args:
  customerId: string, Immutable ID of the Google Workspace account. (required)
  body: object, The request body.
    The object takes the form of:

{ # The type of API resource. For Schema resources, this is always `admin#directory#schema`.
  "displayName": "A String", # Display name for the schema.
  "etag": "A String", # The ETag of the resource.
  "fields": [ # A list of fields in the schema.
    { # You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see [Custom User Fields](/admin-sdk/directory/v1/guides/manage-schemas).
      "displayName": "A String", # Display Name of the field.
      "etag": "A String", # The ETag of the field.
      "fieldId": "A String", # The unique identifier of the field (Read-only)
      "fieldName": "A String", # The name of the field.
      "fieldType": "A String", # The type of the field.
      "indexed": true, # Boolean specifying whether the field is indexed or not. Default: `true`.
      "kind": "admin#directory#schema#fieldspec", # The kind of resource this is. For schema fields this is always `admin#directory#schema#fieldspec`.
      "multiValued": True or False, # A boolean specifying whether this is a multi-valued field or not. Default: `false`.
      "numericIndexingSpec": { # Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the `numericIndexingSpec` allows range queries to be supported.
        "maxValue": 3.14, # Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
        "minValue": 3.14, # Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
      },
      "readAccessType": "ALL_DOMAIN_USERS", # Specifies who can view values of this field. See [Retrieve users as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) for more information. Note: It may take up to 24 hours for changes to this field to be reflected.
    },
  ],
  "kind": "admin#directory#schema", # Kind of resource this is.
  "schemaId": "A String", # The unique identifier of the schema (Read-only)
  "schemaName": "A String", # The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The type of API resource. For Schema resources, this is always `admin#directory#schema`.
  "displayName": "A String", # Display name for the schema.
  "etag": "A String", # The ETag of the resource.
  "fields": [ # A list of fields in the schema.
    { # You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see [Custom User Fields](/admin-sdk/directory/v1/guides/manage-schemas).
      "displayName": "A String", # Display Name of the field.
      "etag": "A String", # The ETag of the field.
      "fieldId": "A String", # The unique identifier of the field (Read-only)
      "fieldName": "A String", # The name of the field.
      "fieldType": "A String", # The type of the field.
      "indexed": true, # Boolean specifying whether the field is indexed or not. Default: `true`.
      "kind": "admin#directory#schema#fieldspec", # The kind of resource this is. For schema fields this is always `admin#directory#schema#fieldspec`.
      "multiValued": True or False, # A boolean specifying whether this is a multi-valued field or not. Default: `false`.
      "numericIndexingSpec": { # Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the `numericIndexingSpec` allows range queries to be supported.
        "maxValue": 3.14, # Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
        "minValue": 3.14, # Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
      },
      "readAccessType": "ALL_DOMAIN_USERS", # Specifies who can view values of this field. See [Retrieve users as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) for more information. Note: It may take up to 24 hours for changes to this field to be reflected.
    },
  ],
  "kind": "admin#directory#schema", # Kind of resource this is.
  "schemaId": "A String", # The unique identifier of the schema (Read-only)
  "schemaName": "A String", # The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
}
list(customerId, x__xgafv=None)
Retrieves all schemas for a customer.

Args:
  customerId: string, Immutable ID of the Google Workspace account. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # JSON response template for List Schema operation in Directory API.
  "etag": "A String", # ETag of the resource.
  "kind": "admin#directory#schemas", # Kind of resource this is.
  "schemas": [ # List of UserSchema objects.
    { # The type of API resource. For Schema resources, this is always `admin#directory#schema`.
      "displayName": "A String", # Display name for the schema.
      "etag": "A String", # The ETag of the resource.
      "fields": [ # A list of fields in the schema.
        { # You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see [Custom User Fields](/admin-sdk/directory/v1/guides/manage-schemas).
          "displayName": "A String", # Display Name of the field.
          "etag": "A String", # The ETag of the field.
          "fieldId": "A String", # The unique identifier of the field (Read-only)
          "fieldName": "A String", # The name of the field.
          "fieldType": "A String", # The type of the field.
          "indexed": true, # Boolean specifying whether the field is indexed or not. Default: `true`.
          "kind": "admin#directory#schema#fieldspec", # The kind of resource this is. For schema fields this is always `admin#directory#schema#fieldspec`.
          "multiValued": True or False, # A boolean specifying whether this is a multi-valued field or not. Default: `false`.
          "numericIndexingSpec": { # Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the `numericIndexingSpec` allows range queries to be supported.
            "maxValue": 3.14, # Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
            "minValue": 3.14, # Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
          },
          "readAccessType": "ALL_DOMAIN_USERS", # Specifies who can view values of this field. See [Retrieve users as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) for more information. Note: It may take up to 24 hours for changes to this field to be reflected.
        },
      ],
      "kind": "admin#directory#schema", # Kind of resource this is.
      "schemaId": "A String", # The unique identifier of the schema (Read-only)
      "schemaName": "A String", # The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
    },
  ],
}
patch(customerId, schemaKey, body=None, x__xgafv=None)
Patches a schema.

Args:
  customerId: string, Immutable ID of the Google Workspace account. (required)
  schemaKey: string, Name or immutable ID of the schema. (required)
  body: object, The request body.
    The object takes the form of:

{ # The type of API resource. For Schema resources, this is always `admin#directory#schema`.
  "displayName": "A String", # Display name for the schema.
  "etag": "A String", # The ETag of the resource.
  "fields": [ # A list of fields in the schema.
    { # You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see [Custom User Fields](/admin-sdk/directory/v1/guides/manage-schemas).
      "displayName": "A String", # Display Name of the field.
      "etag": "A String", # The ETag of the field.
      "fieldId": "A String", # The unique identifier of the field (Read-only)
      "fieldName": "A String", # The name of the field.
      "fieldType": "A String", # The type of the field.
      "indexed": true, # Boolean specifying whether the field is indexed or not. Default: `true`.
      "kind": "admin#directory#schema#fieldspec", # The kind of resource this is. For schema fields this is always `admin#directory#schema#fieldspec`.
      "multiValued": True or False, # A boolean specifying whether this is a multi-valued field or not. Default: `false`.
      "numericIndexingSpec": { # Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the `numericIndexingSpec` allows range queries to be supported.
        "maxValue": 3.14, # Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
        "minValue": 3.14, # Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
      },
      "readAccessType": "ALL_DOMAIN_USERS", # Specifies who can view values of this field. See [Retrieve users as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) for more information. Note: It may take up to 24 hours for changes to this field to be reflected.
    },
  ],
  "kind": "admin#directory#schema", # Kind of resource this is.
  "schemaId": "A String", # The unique identifier of the schema (Read-only)
  "schemaName": "A String", # The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The type of API resource. For Schema resources, this is always `admin#directory#schema`.
  "displayName": "A String", # Display name for the schema.
  "etag": "A String", # The ETag of the resource.
  "fields": [ # A list of fields in the schema.
    { # You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see [Custom User Fields](/admin-sdk/directory/v1/guides/manage-schemas).
      "displayName": "A String", # Display Name of the field.
      "etag": "A String", # The ETag of the field.
      "fieldId": "A String", # The unique identifier of the field (Read-only)
      "fieldName": "A String", # The name of the field.
      "fieldType": "A String", # The type of the field.
      "indexed": true, # Boolean specifying whether the field is indexed or not. Default: `true`.
      "kind": "admin#directory#schema#fieldspec", # The kind of resource this is. For schema fields this is always `admin#directory#schema#fieldspec`.
      "multiValued": True or False, # A boolean specifying whether this is a multi-valued field or not. Default: `false`.
      "numericIndexingSpec": { # Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the `numericIndexingSpec` allows range queries to be supported.
        "maxValue": 3.14, # Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
        "minValue": 3.14, # Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
      },
      "readAccessType": "ALL_DOMAIN_USERS", # Specifies who can view values of this field. See [Retrieve users as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) for more information. Note: It may take up to 24 hours for changes to this field to be reflected.
    },
  ],
  "kind": "admin#directory#schema", # Kind of resource this is.
  "schemaId": "A String", # The unique identifier of the schema (Read-only)
  "schemaName": "A String", # The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
}
update(customerId, schemaKey, body=None, x__xgafv=None)
Updates a schema.

Args:
  customerId: string, Immutable ID of the Google Workspace account. (required)
  schemaKey: string, Name or immutable ID of the schema. (required)
  body: object, The request body.
    The object takes the form of:

{ # The type of API resource. For Schema resources, this is always `admin#directory#schema`.
  "displayName": "A String", # Display name for the schema.
  "etag": "A String", # The ETag of the resource.
  "fields": [ # A list of fields in the schema.
    { # You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see [Custom User Fields](/admin-sdk/directory/v1/guides/manage-schemas).
      "displayName": "A String", # Display Name of the field.
      "etag": "A String", # The ETag of the field.
      "fieldId": "A String", # The unique identifier of the field (Read-only)
      "fieldName": "A String", # The name of the field.
      "fieldType": "A String", # The type of the field.
      "indexed": true, # Boolean specifying whether the field is indexed or not. Default: `true`.
      "kind": "admin#directory#schema#fieldspec", # The kind of resource this is. For schema fields this is always `admin#directory#schema#fieldspec`.
      "multiValued": True or False, # A boolean specifying whether this is a multi-valued field or not. Default: `false`.
      "numericIndexingSpec": { # Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the `numericIndexingSpec` allows range queries to be supported.
        "maxValue": 3.14, # Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
        "minValue": 3.14, # Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
      },
      "readAccessType": "ALL_DOMAIN_USERS", # Specifies who can view values of this field. See [Retrieve users as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) for more information. Note: It may take up to 24 hours for changes to this field to be reflected.
    },
  ],
  "kind": "admin#directory#schema", # Kind of resource this is.
  "schemaId": "A String", # The unique identifier of the schema (Read-only)
  "schemaName": "A String", # The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The type of API resource. For Schema resources, this is always `admin#directory#schema`.
  "displayName": "A String", # Display name for the schema.
  "etag": "A String", # The ETag of the resource.
  "fields": [ # A list of fields in the schema.
    { # You can use schemas to add custom fields to user profiles. You can use these fields to store information such as the projects your users work on, their physical locations, their hire dates, or whatever else fits your business needs. For more information, see [Custom User Fields](/admin-sdk/directory/v1/guides/manage-schemas).
      "displayName": "A String", # Display Name of the field.
      "etag": "A String", # The ETag of the field.
      "fieldId": "A String", # The unique identifier of the field (Read-only)
      "fieldName": "A String", # The name of the field.
      "fieldType": "A String", # The type of the field.
      "indexed": true, # Boolean specifying whether the field is indexed or not. Default: `true`.
      "kind": "admin#directory#schema#fieldspec", # The kind of resource this is. For schema fields this is always `admin#directory#schema#fieldspec`.
      "multiValued": True or False, # A boolean specifying whether this is a multi-valued field or not. Default: `false`.
      "numericIndexingSpec": { # Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the `numericIndexingSpec` allows range queries to be supported.
        "maxValue": 3.14, # Maximum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
        "minValue": 3.14, # Minimum value of this field. This is meant to be indicative rather than enforced. Values outside this range will still be indexed, but search may not be as performant.
      },
      "readAccessType": "ALL_DOMAIN_USERS", # Specifies who can view values of this field. See [Retrieve users as a non-administrator](/admin-sdk/directory/v1/guides/manage-users#retrieve_users_non_admin) for more information. Note: It may take up to 24 hours for changes to this field to be reflected.
    },
  ],
  "kind": "admin#directory#schema", # Kind of resource this is.
  "schemaId": "A String", # The unique identifier of the schema (Read-only)
  "schemaName": "A String", # The schema's name. Each `schema_name` must be unique within a customer. Reusing a name results in a `409: Entity already exists` error.
}