com.pulumi.gcp.siteverification.kotlin.SiteverificationFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.siteverification.kotlin
import com.pulumi.gcp.siteverification.SiteverificationFunctions.getTokenPlain
import com.pulumi.gcp.siteverification.kotlin.inputs.GetTokenPlainArgs
import com.pulumi.gcp.siteverification.kotlin.inputs.GetTokenPlainArgsBuilder
import com.pulumi.gcp.siteverification.kotlin.outputs.GetTokenResult
import com.pulumi.gcp.siteverification.kotlin.outputs.GetTokenResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object SiteverificationFunctions {
/**
* A verification token is used to demonstrate ownership of a website or domain.
* To get more information about Token, see:
* * [API documentation](https://developers.google.com/site-verification/v1)
* * How-to Guides
* * [Getting Started](https://developers.google.com/site-verification/v1/getting_started)
* ## Example Usage
* ### Site Verification Via Site META Tag
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const example = gcp.siteverification.getToken({
* type: "SITE",
* identifier: "https://www.example.com",
* verificationMethod: "META",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.siteverification.get_token(type="SITE",
* identifier="https://www.example.com",
* verification_method="META")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var example = Gcp.SiteVerification.GetToken.Invoke(new()
* {
* Type = "SITE",
* Identifier = "https://www.example.com",
* VerificationMethod = "META",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/siteverification"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := siteverification.GetToken(ctx, &siteverification.GetTokenArgs{
* Type: "SITE",
* Identifier: "https://www.example.com",
* VerificationMethod: "META",
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.siteverification.SiteverificationFunctions;
* import com.pulumi.gcp.siteverification.inputs.GetTokenArgs;
* 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) {
* final var example = SiteverificationFunctions.getToken(GetTokenArgs.builder()
* .type("SITE")
* .identifier("https://www.example.com")
* .verificationMethod("META")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* function: gcp:siteverification:getToken
* arguments:
* type: SITE
* identifier: https://www.example.com
* verificationMethod: META
* ```
*
* ### Site Verification Via DNS TXT Record
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const example = gcp.siteverification.getToken({
* type: "INET_DOMAIN",
* identifier: "www.example.com",
* verificationMethod: "DNS_TXT",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* example = gcp.siteverification.get_token(type="INET_DOMAIN",
* identifier="www.example.com",
* verification_method="DNS_TXT")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var example = Gcp.SiteVerification.GetToken.Invoke(new()
* {
* Type = "INET_DOMAIN",
* Identifier = "www.example.com",
* VerificationMethod = "DNS_TXT",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/siteverification"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := siteverification.GetToken(ctx, &siteverification.GetTokenArgs{
* Type: "INET_DOMAIN",
* Identifier: "www.example.com",
* VerificationMethod: "DNS_TXT",
* }, nil)
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.siteverification.SiteverificationFunctions;
* import com.pulumi.gcp.siteverification.inputs.GetTokenArgs;
* 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) {
* final var example = SiteverificationFunctions.getToken(GetTokenArgs.builder()
* .type("INET_DOMAIN")
* .identifier("www.example.com")
* .verificationMethod("DNS_TXT")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* function: gcp:siteverification:getToken
* arguments:
* type: INET_DOMAIN
* identifier: www.example.com
* verificationMethod: DNS_TXT
* ```
*
* @param argument A collection of arguments for invoking getToken.
* @return A collection of values returned by getToken.
*/
public suspend fun getToken(argument: GetTokenPlainArgs): GetTokenResult =
toKotlin(getTokenPlain(argument.toJava()).await())
/**
* @see [getToken].
* @param identifier The site identifier. If the type is set to SITE, the identifier is a URL. If the type is
* set to INET_DOMAIN, the identifier is a domain name.
* @param type The type of resource to be verified, either a domain or a web site.
* Possible values are: `INET_DOMAIN`, `SITE`.
* @param verificationMethod The verification method for the Site Verification system to use to verify
* this site or domain.
* Possible values are: `ANALYTICS`, `DNS_CNAME`, `DNS_TXT`, `FILE`, `META`, `TAG_MANAGER`.
* - - -
* @return A collection of values returned by getToken.
*/
public suspend fun getToken(
identifier: String,
type: String,
verificationMethod: String,
): GetTokenResult {
val argument = GetTokenPlainArgs(
identifier = identifier,
type = type,
verificationMethod = verificationMethod,
)
return toKotlin(getTokenPlain(argument.toJava()).await())
}
/**
* @see [getToken].
* @param argument Builder for [com.pulumi.gcp.siteverification.kotlin.inputs.GetTokenPlainArgs].
* @return A collection of values returned by getToken.
*/
public suspend fun getToken(argument: suspend GetTokenPlainArgsBuilder.() -> Unit): GetTokenResult {
val builder = GetTokenPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getTokenPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy