Show / Hide Table of Contents

Class EnvironmentDefinitionSerializer

Provides serialization and deserialization for EnvironmentDefinition. The ESC API returns environment definitions as application/x-yaml content from the GetEnvironment, GetEnvironmentAtVersion, and DecryptEnvironment endpoints. The generated client cannot deserialize YAML, so this class bridges that gap.

Inheritance
object
EnvironmentDefinitionSerializer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Pulumi.Esc.Sdk
Assembly: Pulumi.Esc.Sdk.dll
Syntax
public static class EnvironmentDefinitionSerializer

Methods

View Source

Deserialize(string?)

Deserializes YAML content returned by the ESC API into an EnvironmentDefinition. This handles the application/x-yaml responses from GetEnvironment, GetEnvironmentAtVersion, and DecryptEnvironment endpoints.

Declaration
public static EnvironmentDefinition? Deserialize(string? yaml)
Parameters
Type Name Description
string yaml

The raw YAML string from the API response.

Returns
Type Description
EnvironmentDefinition

A parsed EnvironmentDefinition, or null if the input is empty.

View Source

Serialize(EnvironmentDefinition)

Serializes an EnvironmentDefinition to JSON. JSON is valid YAML, so this output can be sent directly to the ESC API for environment definition updates.

Declaration
public static string Serialize(EnvironmentDefinition definition)
Parameters
Type Name Description
EnvironmentDefinition definition

The environment definition to serialize.

Returns
Type Description
string

A JSON string representation of the environment definition.

View Source

SerializeToYaml(EnvironmentDefinition)

Serializes an EnvironmentDefinition to YAML.

Declaration
public static string SerializeToYaml(EnvironmentDefinition definition)
Parameters
Type Name Description
EnvironmentDefinition definition

The environment definition to serialize.

Returns
Type Description
string

A YAML string representation of the environment definition.

Version 0.13.1

  • View Source
Back to top Copyright 2016-2023, Pulumi Corporation.