1. Packages
  2. Googleworkspace Provider
  3. API Docs
  4. Schema
googleworkspace 0.7.0 published on Wednesday, Jan 15, 2025 by hashicorp

googleworkspace.Schema

Explore with Pulumi AI

Schema resource manages Google Workspace Schemas. Schema resides under the https://www.googleapis.com/auth/admin.directory.userschema client scope.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as googleworkspace from "@pulumi/googleworkspace";

const birthday = new googleworkspace.Schema("birthday", {
    fields: [{
        fieldName: "birthday",
        fieldType: "DATE",
    }],
    schemaName: "birthday",
});
Copy
import pulumi
import pulumi_googleworkspace as googleworkspace

birthday = googleworkspace.Schema("birthday",
    fields=[{
        "field_name": "birthday",
        "field_type": "DATE",
    }],
    schema_name="birthday")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/googleworkspace/googleworkspace"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := googleworkspace.NewSchema(ctx, "birthday", &googleworkspace.SchemaArgs{
			Fields: googleworkspace.SchemaFieldArray{
				&googleworkspace.SchemaFieldArgs{
					FieldName: pulumi.String("birthday"),
					FieldType: pulumi.String("DATE"),
				},
			},
			SchemaName: pulumi.String("birthday"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Googleworkspace = Pulumi.Googleworkspace;

return await Deployment.RunAsync(() => 
{
    var birthday = new Googleworkspace.Schema("birthday", new()
    {
        Fields = new[]
        {
            new Googleworkspace.Inputs.SchemaFieldArgs
            {
                FieldName = "birthday",
                FieldType = "DATE",
            },
        },
        SchemaName = "birthday",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.googleworkspace.Schema;
import com.pulumi.googleworkspace.SchemaArgs;
import com.pulumi.googleworkspace.inputs.SchemaFieldArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var birthday = new Schema("birthday", SchemaArgs.builder()
            .fields(SchemaFieldArgs.builder()
                .fieldName("birthday")
                .fieldType("DATE")
                .build())
            .schemaName("birthday")
            .build());

    }
}
Copy
resources:
  birthday:
    type: googleworkspace:Schema
    properties:
      fields:
        - fieldName: birthday
          fieldType: DATE
      schemaName: birthday
Copy

Create Schema Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Schema(name: string, args: SchemaArgs, opts?: CustomResourceOptions);
@overload
def Schema(resource_name: str,
           args: SchemaArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def Schema(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           fields: Optional[Sequence[SchemaFieldArgs]] = None,
           schema_name: Optional[str] = None,
           display_name: Optional[str] = None,
           timeouts: Optional[SchemaTimeoutsArgs] = None)
func NewSchema(ctx *Context, name string, args SchemaArgs, opts ...ResourceOption) (*Schema, error)
public Schema(string name, SchemaArgs args, CustomResourceOptions? opts = null)
public Schema(String name, SchemaArgs args)
public Schema(String name, SchemaArgs args, CustomResourceOptions options)
type: googleworkspace:Schema
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SchemaArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SchemaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SchemaArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var schemaResource = new Googleworkspace.Schema("schemaResource", new()
{
    Fields = new[]
    {
        new Googleworkspace.Inputs.SchemaFieldArgs
        {
            FieldName = "string",
            FieldType = "string",
            DisplayName = "string",
            Etag = "string",
            FieldId = "string",
            Indexed = false,
            MultiValued = false,
            NumericIndexingSpec = new Googleworkspace.Inputs.SchemaFieldNumericIndexingSpecArgs
            {
                MaxValue = 0,
                MinValue = 0,
            },
            ReadAccessType = "string",
        },
    },
    SchemaName = "string",
    DisplayName = "string",
    Timeouts = new Googleworkspace.Inputs.SchemaTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Update = "string",
    },
});
Copy
example, err := googleworkspace.NewSchema(ctx, "schemaResource", &googleworkspace.SchemaArgs{
Fields: .SchemaFieldArray{
&.SchemaFieldArgs{
FieldName: pulumi.String("string"),
FieldType: pulumi.String("string"),
DisplayName: pulumi.String("string"),
Etag: pulumi.String("string"),
FieldId: pulumi.String("string"),
Indexed: pulumi.Bool(false),
MultiValued: pulumi.Bool(false),
NumericIndexingSpec: &.SchemaFieldNumericIndexingSpecArgs{
MaxValue: pulumi.Float64(0),
MinValue: pulumi.Float64(0),
},
ReadAccessType: pulumi.String("string"),
},
},
SchemaName: pulumi.String("string"),
DisplayName: pulumi.String("string"),
Timeouts: &.SchemaTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
Copy
var schemaResource = new Schema("schemaResource", SchemaArgs.builder()
    .fields(SchemaFieldArgs.builder()
        .fieldName("string")
        .fieldType("string")
        .displayName("string")
        .etag("string")
        .fieldId("string")
        .indexed(false)
        .multiValued(false)
        .numericIndexingSpec(SchemaFieldNumericIndexingSpecArgs.builder()
            .maxValue(0)
            .minValue(0)
            .build())
        .readAccessType("string")
        .build())
    .schemaName("string")
    .displayName("string")
    .timeouts(SchemaTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .update("string")
        .build())
    .build());
Copy
schema_resource = googleworkspace.Schema("schemaResource",
    fields=[{
        "field_name": "string",
        "field_type": "string",
        "display_name": "string",
        "etag": "string",
        "field_id": "string",
        "indexed": False,
        "multi_valued": False,
        "numeric_indexing_spec": {
            "max_value": 0,
            "min_value": 0,
        },
        "read_access_type": "string",
    }],
    schema_name="string",
    display_name="string",
    timeouts={
        "create": "string",
        "delete": "string",
        "update": "string",
    })
Copy
const schemaResource = new googleworkspace.Schema("schemaResource", {
    fields: [{
        fieldName: "string",
        fieldType: "string",
        displayName: "string",
        etag: "string",
        fieldId: "string",
        indexed: false,
        multiValued: false,
        numericIndexingSpec: {
            maxValue: 0,
            minValue: 0,
        },
        readAccessType: "string",
    }],
    schemaName: "string",
    displayName: "string",
    timeouts: {
        create: "string",
        "delete": "string",
        update: "string",
    },
});
Copy
type: googleworkspace:Schema
properties:
    displayName: string
    fields:
        - displayName: string
          etag: string
          fieldId: string
          fieldName: string
          fieldType: string
          indexed: false
          multiValued: false
          numericIndexingSpec:
            maxValue: 0
            minValue: 0
          readAccessType: string
    schemaName: string
    timeouts:
        create: string
        delete: string
        update: string
Copy

Schema Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Schema resource accepts the following input properties:

Fields This property is required. List<SchemaField>
A list of fields in the schema.
SchemaName This property is required. string
The schema's name.
DisplayName string
Display name for the schema.
Timeouts SchemaTimeouts
Fields This property is required. []SchemaFieldArgs
A list of fields in the schema.
SchemaName This property is required. string
The schema's name.
DisplayName string
Display name for the schema.
Timeouts SchemaTimeoutsArgs
fields This property is required. List<SchemaField>
A list of fields in the schema.
schemaName This property is required. String
The schema's name.
displayName String
Display name for the schema.
timeouts SchemaTimeouts
fields This property is required. SchemaField[]
A list of fields in the schema.
schemaName This property is required. string
The schema's name.
displayName string
Display name for the schema.
timeouts SchemaTimeouts
fields This property is required. Sequence[SchemaFieldArgs]
A list of fields in the schema.
schema_name This property is required. str
The schema's name.
display_name str
Display name for the schema.
timeouts SchemaTimeoutsArgs
fields This property is required. List<Property Map>
A list of fields in the schema.
schemaName This property is required. String
The schema's name.
displayName String
Display name for the schema.
timeouts Property Map

Outputs

All input properties are implicitly available as output properties. Additionally, the Schema resource produces the following output properties:

Etag string
ETag of the resource.
Id string
The provider-assigned unique ID for this managed resource.
SchemaId string
The unique identifier of the schema.
Etag string
ETag of the resource.
Id string
The provider-assigned unique ID for this managed resource.
SchemaId string
The unique identifier of the schema.
etag String
ETag of the resource.
id String
The provider-assigned unique ID for this managed resource.
schemaId String
The unique identifier of the schema.
etag string
ETag of the resource.
id string
The provider-assigned unique ID for this managed resource.
schemaId string
The unique identifier of the schema.
etag str
ETag of the resource.
id str
The provider-assigned unique ID for this managed resource.
schema_id str
The unique identifier of the schema.
etag String
ETag of the resource.
id String
The provider-assigned unique ID for this managed resource.
schemaId String
The unique identifier of the schema.

Look up Existing Schema Resource

Get an existing Schema resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: SchemaState, opts?: CustomResourceOptions): Schema
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        display_name: Optional[str] = None,
        etag: Optional[str] = None,
        fields: Optional[Sequence[SchemaFieldArgs]] = None,
        schema_id: Optional[str] = None,
        schema_name: Optional[str] = None,
        timeouts: Optional[SchemaTimeoutsArgs] = None) -> Schema
func GetSchema(ctx *Context, name string, id IDInput, state *SchemaState, opts ...ResourceOption) (*Schema, error)
public static Schema Get(string name, Input<string> id, SchemaState? state, CustomResourceOptions? opts = null)
public static Schema get(String name, Output<String> id, SchemaState state, CustomResourceOptions options)
resources:  _:    type: googleworkspace:Schema    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
DisplayName string
Display name for the schema.
Etag string
ETag of the resource.
Fields List<SchemaField>
A list of fields in the schema.
SchemaId string
The unique identifier of the schema.
SchemaName string
The schema's name.
Timeouts SchemaTimeouts
DisplayName string
Display name for the schema.
Etag string
ETag of the resource.
Fields []SchemaFieldArgs
A list of fields in the schema.
SchemaId string
The unique identifier of the schema.
SchemaName string
The schema's name.
Timeouts SchemaTimeoutsArgs
displayName String
Display name for the schema.
etag String
ETag of the resource.
fields List<SchemaField>
A list of fields in the schema.
schemaId String
The unique identifier of the schema.
schemaName String
The schema's name.
timeouts SchemaTimeouts
displayName string
Display name for the schema.
etag string
ETag of the resource.
fields SchemaField[]
A list of fields in the schema.
schemaId string
The unique identifier of the schema.
schemaName string
The schema's name.
timeouts SchemaTimeouts
display_name str
Display name for the schema.
etag str
ETag of the resource.
fields Sequence[SchemaFieldArgs]
A list of fields in the schema.
schema_id str
The unique identifier of the schema.
schema_name str
The schema's name.
timeouts SchemaTimeoutsArgs
displayName String
Display name for the schema.
etag String
ETag of the resource.
fields List<Property Map>
A list of fields in the schema.
schemaId String
The unique identifier of the schema.
schemaName String
The schema's name.
timeouts Property Map

Supporting Types

SchemaField
, SchemaFieldArgs

FieldName This property is required. string
The name of the field.
FieldType This property is required. string
The type of the field. Acceptable values are: - BOOL - DATE - DOUBLE - EMAIL - INT64 - PHONE - STRING
DisplayName string
Display Name of the field.
Etag string
The ETag of the field.
FieldId string
The unique identifier of the field.
Indexed bool
Defaults to true. Boolean specifying whether the field is indexed or not.
MultiValued bool
Defaults to false. A boolean specifying whether this is a multi-valued field or not.
NumericIndexingSpec SchemaFieldNumericIndexingSpec
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.
ReadAccessType string
Defaults to ALL_DOMAIN_USERS. Specifies who can view values of this field. See Retrieve users as a non-administrator for more information. Acceptable values are: - ADMINS_AND_SELF - ALL_DOMAIN_USERS Note: It may take up to 24 hours for changes to this field to be reflected.
FieldName This property is required. string
The name of the field.
FieldType This property is required. string
The type of the field. Acceptable values are: - BOOL - DATE - DOUBLE - EMAIL - INT64 - PHONE - STRING
DisplayName string
Display Name of the field.
Etag string
The ETag of the field.
FieldId string
The unique identifier of the field.
Indexed bool
Defaults to true. Boolean specifying whether the field is indexed or not.
MultiValued bool
Defaults to false. A boolean specifying whether this is a multi-valued field or not.
NumericIndexingSpec SchemaFieldNumericIndexingSpec
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.
ReadAccessType string
Defaults to ALL_DOMAIN_USERS. Specifies who can view values of this field. See Retrieve users as a non-administrator for more information. Acceptable values are: - ADMINS_AND_SELF - ALL_DOMAIN_USERS Note: It may take up to 24 hours for changes to this field to be reflected.
fieldName This property is required. String
The name of the field.
fieldType This property is required. String
The type of the field. Acceptable values are: - BOOL - DATE - DOUBLE - EMAIL - INT64 - PHONE - STRING
displayName String
Display Name of the field.
etag String
The ETag of the field.
fieldId String
The unique identifier of the field.
indexed Boolean
Defaults to true. Boolean specifying whether the field is indexed or not.
multiValued Boolean
Defaults to false. A boolean specifying whether this is a multi-valued field or not.
numericIndexingSpec SchemaFieldNumericIndexingSpec
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.
readAccessType String
Defaults to ALL_DOMAIN_USERS. Specifies who can view values of this field. See Retrieve users as a non-administrator for more information. Acceptable values are: - ADMINS_AND_SELF - ALL_DOMAIN_USERS Note: It may take up to 24 hours for changes to this field to be reflected.
fieldName This property is required. string
The name of the field.
fieldType This property is required. string
The type of the field. Acceptable values are: - BOOL - DATE - DOUBLE - EMAIL - INT64 - PHONE - STRING
displayName string
Display Name of the field.
etag string
The ETag of the field.
fieldId string
The unique identifier of the field.
indexed boolean
Defaults to true. Boolean specifying whether the field is indexed or not.
multiValued boolean
Defaults to false. A boolean specifying whether this is a multi-valued field or not.
numericIndexingSpec SchemaFieldNumericIndexingSpec
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.
readAccessType string
Defaults to ALL_DOMAIN_USERS. Specifies who can view values of this field. See Retrieve users as a non-administrator for more information. Acceptable values are: - ADMINS_AND_SELF - ALL_DOMAIN_USERS Note: It may take up to 24 hours for changes to this field to be reflected.
field_name This property is required. str
The name of the field.
field_type This property is required. str
The type of the field. Acceptable values are: - BOOL - DATE - DOUBLE - EMAIL - INT64 - PHONE - STRING
display_name str
Display Name of the field.
etag str
The ETag of the field.
field_id str
The unique identifier of the field.
indexed bool
Defaults to true. Boolean specifying whether the field is indexed or not.
multi_valued bool
Defaults to false. A boolean specifying whether this is a multi-valued field or not.
numeric_indexing_spec SchemaFieldNumericIndexingSpec
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.
read_access_type str
Defaults to ALL_DOMAIN_USERS. Specifies who can view values of this field. See Retrieve users as a non-administrator for more information. Acceptable values are: - ADMINS_AND_SELF - ALL_DOMAIN_USERS Note: It may take up to 24 hours for changes to this field to be reflected.
fieldName This property is required. String
The name of the field.
fieldType This property is required. String
The type of the field. Acceptable values are: - BOOL - DATE - DOUBLE - EMAIL - INT64 - PHONE - STRING
displayName String
Display Name of the field.
etag String
The ETag of the field.
fieldId String
The unique identifier of the field.
indexed Boolean
Defaults to true. Boolean specifying whether the field is indexed or not.
multiValued Boolean
Defaults to false. A boolean specifying whether this is a multi-valued field or not.
numericIndexingSpec Property Map
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.
readAccessType String
Defaults to ALL_DOMAIN_USERS. Specifies who can view values of this field. See Retrieve users as a non-administrator for more information. Acceptable values are: - ADMINS_AND_SELF - ALL_DOMAIN_USERS Note: It may take up to 24 hours for changes to this field to be reflected.

SchemaFieldNumericIndexingSpec
, SchemaFieldNumericIndexingSpecArgs

MaxValue double
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 double
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.
MaxValue float64
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 float64
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.
maxValue Double
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 Double
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.
maxValue number
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 number
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.
max_value float
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.
min_value float
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.
maxValue Number
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 Number
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.

SchemaTimeouts
, SchemaTimeoutsArgs

Create string
Delete string
Update string
Create string
Delete string
Update string
create String
delete String
update String
create string
delete string
update string
create str
delete str
update str
create String
delete String
update String

Import

$ pulumi import googleworkspace:index/schema:Schema birthday Ab0C_DEFGhIJKLmNopQ1Rs==
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
googleworkspace hashicorp/terraform-provider-googleworkspace
License
Notes
This Pulumi package is based on the googleworkspace Terraform Provider.