var o=Object.defineProperty;var s=(r,n)=>{for(var t in n)o(r,t,{get:n[t],enumerable:!0})};var e={};s(e,{namespace:()=>i});var i="LiftrBase";var p={"dist/src/index.js":e},c={"package.json":'{"name":"@azure-tools/typespec-liftr-base","version":"0.8.0","author":"Microsoft Corporation","description":"LiftrBase TypeSpec library","type":"module","main":"dist/src/index.js","tspMain":"lib/main.tsp","exports":{".":{"types":"./dist/src/index.d.ts","default":"./dist/src/index.js"}},"devDependencies":{"@azure-tools/typespec-apiview":"0.5.0","@azure-tools/typespec-autorest":"0.51.0","@azure-tools/typespec-azure-core":"0.51.0","@azure-tools/typespec-azure-portal-core":"0.51.0","@azure-tools/typespec-azure-resource-manager":"0.51.0","@azure-tools/typespec-client-generator-core":"0.51.3","@azure-tools/typespec-azure-rulesets":"0.51.0","@typespec/library-linter":"0.65.0","@azure/avocado":"^0.8.4","@typespec/compiler":"0.65.0","@typespec/http":"0.65.0","@typespec/openapi":"0.65.0","@typespec/openapi3":"0.65.0","@typespec/rest":"0.65.0","@typespec/versioning":"0.65.0","@vitest/coverage-v8":"^2.0.4","@vitest/ui":"^2.0.4","c8":"^10.1.2","source-map-support":"~0.5.21","typescript":"~5.6.3","vitest":"^2.1.2","rimraf":"~6.0.1"},"scripts":{"clean":"rimraf ./dist ./temp","build":"tsc -p . && npm run lint-typespec-library","test":"mocha","lint-typespec-library":"tsp compile . --warn-as-error --import @typespec/library-linter --no-emit"}}',"../../../../../../src/typespec/core/packages/compiler/lib/intrinsics.tsp":`import "../dist/src/lib/intrinsic/tsp-index.js";
import "./prototypes.tsp";

// This file contains all the intrinsic types of typespec. Everything here will always be loaded
namespace TypeSpec;

/**
 * Represent a byte array
 */
scalar bytes;

/**
 * A numeric type
 */
scalar numeric;

/**
 * A whole number. This represent any \`integer\` value possible.
 * It is commonly represented as \`BigInteger\` in some languages.
 */
scalar integer extends numeric;

/**
 * A number with decimal value
 */
scalar float extends numeric;

/**
 * A 64-bit integer. (\`-9,223,372,036,854,775,808\` to \`9,223,372,036,854,775,807\`)
 */
scalar int64 extends integer;

/**
 * A 32-bit integer. (\`-2,147,483,648\` to \`2,147,483,647\`)
 */
scalar int32 extends int64;

/**
 * A 16-bit integer. (\`-32,768\` to \`32,767\`)
 */
scalar int16 extends int32;

/**
 * A 8-bit integer. (\`-128\` to \`127\`)
 */
scalar int8 extends int16;

/**
 * A 64-bit unsigned integer (\`0\` to \`18,446,744,073,709,551,615\`)
 */
scalar uint64 extends integer;

/**
 * A 32-bit unsigned integer (\`0\` to \`4,294,967,295\`)
 */
scalar uint32 extends uint64;

/**
 * A 16-bit unsigned integer (\`0\` to \`65,535\`)
 */
scalar uint16 extends uint32;

/**
 * A 8-bit unsigned integer (\`0\` to \`255\`)
 */
scalar uint8 extends uint16;

/**
 * An integer that can be serialized to JSON (\`\u22129007199254740991 (\u2212(2^53 \u2212 1))\` to \`9007199254740991 (2^53 \u2212 1)\` )
 */
scalar safeint extends int64;

/**
 * A 64 bit floating point number. (\`\xB15.0 \xD7 10^\u2212324\` to \`\xB11.7 \xD7 10^308\`)
 */
scalar float64 extends float;

/**
 * A 32 bit floating point number. (\`\xB11.5 x 10^\u221245\` to \`\xB13.4 x 10^38\`)
 */
scalar float32 extends float64;

/**
 * A decimal number with any length and precision. This represent any \`decimal\` value possible.
 * It is commonly represented as \`BigDecimal\` in some languages.
 */
scalar decimal extends numeric;

/**
 * A 128-bit decimal number.
 */
scalar decimal128 extends decimal;

/**
 * A sequence of textual characters.
 */
scalar string;

/**
 * A date on a calendar without a time zone, e.g. "April 10th"
 */
scalar plainDate {
  /**
   * Create a plain date from an ISO 8601 string.
   * @example
   *
   * \`\`\`tsp
   * const date = plainDate.fromISO("2024-05-06");
   * \`\`\`
   */
  init fromISO(value: string);

  /**
   * Create a plain date representing the current date.
   * @example
   *
   * \`\`\`tsp
   * const date = plainDate.now();
   * \`\`\`
   */
  init now();
}

/**
 * A time on a clock without a time zone, e.g. "3:00 am"
 */
scalar plainTime {
  /**
   * Create a plain time from an ISO 8601 string.
   * @example
   *
   * \`\`\`tsp
   * const time = plainTime.fromISO("12:34");
   * \`\`\`
   */
  init fromISO(value: string);

  /**
   * Create a plain time representing the current time.
   * @example
   *
   * \`\`\`tsp
   * const time = plainTime.now();
   * \`\`\`
   */
  init now();
}

/**
 * An instant in coordinated universal time (UTC)"
 */
scalar utcDateTime {
  /**
   * Create a date from an ISO 8601 string.
   * @example
   *
   * \`\`\`tsp
   * const time = utcDateTime.fromISO("2024-05-06T12:20-12Z");
   * \`\`\`
   */
  init fromISO(value: string);

  /**
   * Create a date representing the current date and time in UTC.
   * @example
   *
   * \`\`\`tsp
   * const time = utcDateTime.now();
   * \`\`\`
   */
  init now();
}

/**
 * A date and time in a particular time zone, e.g. "April 10th at 3:00am in PST"
 */
scalar offsetDateTime {
  /**
   * Create a date from an ISO 8601 string.
   * @example
   *
   * \`\`\`tsp
   * const time = offsetDateTime.fromISO("2024-05-06T12:20-12-0700");
   * \`\`\`
   */
  init fromISO(value: string);

  /**
   * Create a date representing the current date and time with offset.
   * @example
   *
   * \`\`\`tsp
   * const time = offsetDateTime.now();
   * \`\`\`
   */
  init now();
}

/**
 * A duration/time period. e.g 5s, 10h
 */
scalar duration {
  /**
   * Create a duration from an ISO 8601 string.
   * @example
   *
   * \`\`\`tsp
   * const time = duration.fromISO("P1Y1D");
   * \`\`\`
   */
  init fromISO(value: string);
}

/**
 * Boolean with \`true\` and \`false\` values.
 */
scalar boolean;

/**
 * @dev Array model type, equivalent to \`Element[]\`
 * @template Element The type of the array elements
 */
@indexer(integer, Element)
model Array<Element> {}

/**
 * @dev Model with string properties where all the properties have type \`Property\`
 * @template Element The type of the properties
 */
@indexer(string, Element)
model Record<Element> {}
`,"../../../../../../src/typespec/core/packages/compiler/lib/prototypes.tsp":`namespace TypeSpec.Prototypes;

internal extern dec getter(target: unknown);

namespace Types {
  interface ModelProperty {
    @getter type(): unknown;
  }

  interface Operation {
    @getter returnType(): unknown;
    @getter parameters(): unknown;
  }

  interface Array<TElementType> {
    @getter elementType(): TElementType;
  }
}
`,"../../../../../../src/typespec/core/packages/compiler/lib/std/main.tsp":`// TypeSpec standard library. Everything in here can be omitted by using \`--nostdlib\` cli flag or \`nostdlib\` in the config.
import "./types.tsp";
import "./decorators.tsp";
import "./reflection.tsp";
import "./visibility.tsp";
`,"../../../../../../src/typespec/core/packages/compiler/lib/std/types.tsp":`namespace TypeSpec;

/**
 * Represent a 32-bit unix timestamp datetime with 1s of granularity.
 * It measures time by the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970.
 */
@encode("unixTimestamp", int32)
scalar unixTimestamp32 extends utcDateTime;

/**
 * Represent a URL string as described by https://url.spec.whatwg.org/
 */
scalar url extends string;

/**
 * Represents a collection of optional properties.
 *
 * @template Source An object whose spread properties are all optional.
 */
@doc("The template for adding optional properties.")
@withOptionalProperties
model OptionalProperties<Source> {
  ...Source;
}

/**
 * Represents a collection of updateable properties.
 *
 * @template Source An object whose spread properties are all updateable.
 */
@doc("The template for adding updateable properties.")
@withUpdateableProperties
model UpdateableProperties<Source> {
  ...Source;
}

/**
 * Represents a collection of omitted properties.
 *
 * @template Source An object whose properties are spread.
 * @template Keys The property keys to omit.
 */
@doc("The template for omitting properties.")
@withoutOmittedProperties(Keys)
model OmitProperties<Source, Keys extends string> {
  ...Source;
}

/**
 * Represents a collection of properties with only the specified keys included.
 *
 * @template Source An object whose properties are spread.
 * @template Keys The property keys to include.
 */
@doc("The template for picking properties.")
@withPickedProperties(Keys)
model PickProperties<Source, Keys extends string> {
  ...Source;
}

/**
 * Represents a collection of properties with default values omitted.
 *
 * @template Source An object whose spread property defaults are all omitted.
 */
@withoutDefaultValues
model OmitDefaults<Source> {
  ...Source;
}

/**
 * Applies a visibility setting to a collection of properties.
 *
 * @template Source An object whose properties are spread.
 * @template Visibility The visibility to apply to all properties.
 */
@doc("The template for setting the default visibility of key properties.")
@withDefaultKeyVisibility(Visibility)
model DefaultKeyVisibility<Source, Visibility extends valueof Reflection.EnumMember> {
  ...Source;
}
`,"../../../../../../src/typespec/core/packages/compiler/lib/std/decorators.tsp":`import "../../dist/src/lib/tsp-index.js";

using TypeSpec.Reflection;

namespace TypeSpec;

/**
 * Typically a short, single-line description.
 * @param summary Summary string.
 *
 * @example
 * \`\`\`typespec
 * @summary("This is a pet")
 * model Pet {}
 * \`\`\`
 */
extern dec summary(target: unknown, summary: valueof string);

/**
 * Attach a documentation string. Content support CommonMark markdown formatting.
 * @param doc Documentation string
 * @param formatArgs Record with key value pair that can be interpolated in the doc.
 *
 * @example
 * \`\`\`typespec
 * @doc("Represent a Pet available in the PetStore")
 * model Pet {}
 * \`\`\`
 */
extern dec doc(target: unknown, doc: valueof string, formatArgs?: {});

/**
 * Attach a documentation string to describe the successful return types of an operation.
 * If an operation returns a union of success and errors it only describes the success. See \`@errorsDoc\` for error documentation.
 * @param doc Documentation string
 *
 * @example
 * \`\`\`typespec
 * @returnsDoc("Returns doc")
 * op get(): Pet | NotFound;
 * \`\`\`
 */
extern dec returnsDoc(target: Operation, doc: valueof string);

/**
 * Attach a documentation string to describe the error return types of an operation.
 * If an operation returns a union of success and errors it only describes the errors. See \`@returnsDoc\` for success documentation.
 * @param doc Documentation string
 *
 * @example
 * \`\`\`typespec
 * @errorsDoc("Errors doc")
 * op get(): Pet | NotFound;
 * \`\`\`
 */
extern dec errorsDoc(target: Operation, doc: valueof string);

/**
 * Service options.
 */
model ServiceOptions {
  /**
   * Title of the service.
   */
  title?: string;
}

/**
 * Mark this namespace as describing a service and configure service properties.
 * @param options Optional configuration for the service.
 *
 * @example
 * \`\`\`typespec
 * @service
 * namespace PetStore;
 * \`\`\`
 *
 * @example Setting service title
 * \`\`\`typespec
 * @service(#{title: "Pet store"})
 * namespace PetStore;
 * \`\`\`
 */
extern dec service(target: Namespace, options?: valueof ServiceOptions);

/**
 * Specify that this model is an error type. Operations return error types when the operation has failed.
 *
 * @example
 * \`\`\`typespec
 * @error
 * model PetStoreError {
 *   code: string;
 *   message: string;
 * }
 * \`\`\`
 */
extern dec error(target: Model);

/**
 * Applies a media type hint to a TypeSpec type. Emitters and libraries may choose to use this hint to determine how a
 * type should be serialized. For example, the \`@typespec/http\` library will use the media type hint of the response
 * body type as a default \`Content-Type\` if one is not explicitly specified in the operation.
 *
 * Media types (also known as MIME types) are defined by RFC 6838. The media type hint should be a valid media type
 * string as defined by the RFC, but the decorator does not enforce or validate this constraint.
 *
 * Notes: the applied media type is _only_ a hint. It may be overridden or not used at all. Media type hints are
 * inherited by subtypes. If a media type hint is applied to a model, it will be inherited by all other models that
 * \`extend\` it unless they delcare their own media type hint.
 *
 * @param mediaType The media type hint to apply to the target type.
 *
 * @example create a model that serializes as XML by default
 *
 * \`\`\`tsp
 * @mediaTypeHint("application/xml")
 * model Example {
 *   @visibility(Lifecycle.Read)
 *   id: string;
 *
 *   name: string;
 * }
 * \`\`\`
 */
extern dec mediaTypeHint(target: Model | Scalar | Enum | Union, mediaType: valueof string);

// Cannot apply this to the scalar itself. Needs to be applied here so that we don't crash nostdlib scenarios
@@mediaTypeHint(TypeSpec.bytes, "application/octet-stream");

// @@mediaTypeHint(TypeSpec.string "text/plain") -- This is hardcoded in the compiler to avoid circularity
// between the initialization of the string scalar and the \`valueof string\` required to call the
// \`mediaTypeHint\` decorator.

/**
 * Specify a known data format hint for this string type. For example \`uuid\`, \`uri\`, etc.
 * This differs from the \`@pattern\` decorator which is meant to specify a regular expression while \`@format\` accepts a known format name.
 * The format names are open ended and are left to emitter to interpret.
 *
 * @param format format name.
 *
 * @example
 * \`\`\`typespec
 * @format("uuid")
 * scalar uuid extends string;
 * \`\`\`
 */
extern dec format(target: string | ModelProperty, format: valueof string);

/**
 * Specify the the pattern this string should respect using simple regular expression syntax.
 * The following syntax is allowed: alternations (\`|\`), quantifiers (\`?\`, \`*\`, \`+\`, and \`{ }\`), wildcard (\`.\`), and grouping parentheses.
 * Advanced features like look-around, capture groups, and references are not supported.
 *
 * This decorator may optionally provide a custom validation _message_. Emitters may choose to use the message to provide
 * context when pattern validation fails. For the sake of consistency, the message should be a phrase that describes in
 * plain language what sort of content the pattern attempts to validate. For example, a complex regular expression that
 * validates a GUID string might have a message like "Must be a valid GUID."
 *
 * @param pattern Regular expression.
 * @param validationMessage Optional validation message that may provide context when validation fails.
 *
 * @example
 * \`\`\`typespec
 * @pattern("[a-z]+", "Must be a string consisting of only lower case letters and of at least one character.")
 * scalar LowerAlpha extends string;
 * \`\`\`
 */
extern dec pattern(
  target: string | bytes | ModelProperty,
  pattern: valueof string,
  validationMessage?: valueof string
);

/**
 * Specify the minimum length this string type should be.
 * @param value Minimum length
 *
 * @example
 * \`\`\`typespec
 * @minLength(2)
 * scalar Username extends string;
 * \`\`\`
 */
extern dec minLength(target: string | ModelProperty, value: valueof integer);

/**
 * Specify the maximum length this string type should be.
 * @param value Maximum length
 *
 * @example
 * \`\`\`typespec
 * @maxLength(20)
 * scalar Username extends string;
 * \`\`\`
 */
extern dec maxLength(target: string | ModelProperty, value: valueof integer);

/** Types that can have range limits */
alias RangeLimitableTypes =
  | numeric
  | utcDateTime
  | offsetDateTime
  | plainDate
  | plainTime
  | duration;

/**
 * Specify the minimum number of items this array should have.
 * @param value Minimum number
 *
 * @example
 * \`\`\`typespec
 * @minItems(1)
 * model Endpoints is string[];
 * \`\`\`
 */
extern dec minItems(target: unknown[] | ModelProperty, value: valueof integer);

/**
 * Specify the maximum number of items this array should have.
 * @param value Maximum number
 *
 * @example
 * \`\`\`typespec
 * @maxItems(5)
 * model Endpoints is string[];
 * \`\`\`
 */
extern dec maxItems(target: unknown[] | ModelProperty, value: valueof integer);

/**
 * Specify the minimum value this numeric type should be.
 * @param value Minimum value
 *
 * @example
 * \`\`\`typespec
 * @minValue(18)
 * scalar Age is int32;
 * \`\`\`
 */
extern dec minValue(
  target: RangeLimitableTypes | ModelProperty,
  value: valueof RangeLimitableTypes
);

/**
 * Specify the maximum value this numeric type should be.
 * @param value Maximum value
 *
 * @example
 * \`\`\`typespec
 * @maxValue(200)
 * scalar Age is int32;
 * \`\`\`
 */
extern dec maxValue(
  target: RangeLimitableTypes | ModelProperty,
  value: valueof RangeLimitableTypes
);

/**
 * Specify the minimum value this numeric type should be, exclusive of the given
 * value.
 * @param value Minimum value
 *
 * @example
 * \`\`\`typespec
 * @minValueExclusive(0)
 * scalar distance is float64;
 * \`\`\`
 */
extern dec minValueExclusive(
  target: RangeLimitableTypes | ModelProperty,
  value: valueof RangeLimitableTypes
);

/**
 * Specify the maximum value this numeric type should be, exclusive of the given
 * value.
 * @param value Maximum value
 *
 * @example
 * \`\`\`typespec
 * @maxValueExclusive(50)
 * scalar distance is float64;
 * \`\`\`
 */
extern dec maxValueExclusive(
  target: RangeLimitableTypes | ModelProperty,
  value: valueof RangeLimitableTypes
);

/**
 * Mark this value as a secret value that should be treated carefully to avoid exposure
 *
 * @example
 * \`\`\`typespec
 * @secret
 * scalar Password is string;
 * \`\`\`
 */
extern dec secret(target: Scalar | ModelProperty | Model | Union | Enum);

/**
 * Attaches a tag to an operation, interface, or namespace. Multiple \`@tag\` decorators can be specified to attach multiple tags to a TypeSpec element.
 * @param tag Tag value
 */
extern dec tag(target: Namespace | Interface | Operation, tag: valueof string);

/**
 * Specifies how a templated type should name their instances.
 * @param name name the template instance should take
 * @param formatArgs Model with key value used to interpolate the name
 *
 * @example
 * \`\`\`typespec
 * @friendlyName("{name}List", T)
 * model List<Item> {
 *   value: Item[];
 *   nextLink: string;
 * }
 * \`\`\`
 */
extern dec friendlyName(target: unknown, name: valueof string, formatArgs?: unknown);

/**
 * Mark a model property as the key to identify instances of that type
 * @param altName Name of the property. If not specified, the decorated property name is used.
 *
 * @example
 * \`\`\`typespec
 * model Pet {
 *   @key id: string;
 * }
 * \`\`\`
 */
extern dec key(target: ModelProperty, altName?: valueof string);

/**
 * Specify this operation is an overload of the given operation.
 * @param overloadbase Base operation that should be a union of all overloads
 *
 * @example
 * \`\`\`typespec
 * op upload(data: string | bytes, @header contentType: "text/plain" | "application/octet-stream"): void;
 * @overload(upload)
 * op uploadString(data: string, @header contentType: "text/plain" ): void;
 * @overload(upload)
 * op uploadBytes(data: bytes, @header contentType: "application/octet-stream"): void;
 * \`\`\`
 */
extern dec overload(target: Operation, overloadbase: Operation);

/**
 * Provide an alternative name for this type when serialized to the given mime type.
 * @param mimeType Mime type this should apply to. The mime type should be a known mime type as described here https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types without any suffix (e.g. \`+json\`)
 * @param name Alternative name
 *
 * @example
 *
 * \`\`\`typespec
 * model Certificate {
 *   @encodedName("application/json", "exp")
 *   @encodedName("application/xml", "expiry")
 *   expireAt: int32;
 * }
 * \`\`\`
 *
 * @example Invalid values
 *
 * \`\`\`typespec
 * @encodedName("application/merge-patch+json", "exp")
 *              ^ error cannot use subtype
 * \`\`\`
 */
extern dec encodedName(target: unknown, mimeType: valueof string, name: valueof string);

/**
 * Options for \`@discriminated\` decorator.
 */
model DiscriminatedOptions {
  /**
   * How is the discriminated union serialized.
   * @default object
   */
  envelope?: "object" | "none";

  /** Name of the discriminator property */
  discriminatorPropertyName?: string;

  /** Name of the property envelopping the data */
  envelopePropertyName?: string;
}

/**
 * Specify that this union is discriminated.
 * @param options Options to configure the serialization of the discriminated union.
 *
 * @example
 *
 * \`\`\`typespec
 * @discriminated
 * union Pet{ cat: Cat, dog: Dog }
 *
 * model Cat { name: string, meow: boolean }
 * model Dog { name: string, bark: boolean }
 * \`\`\`
 * Serialized as:
 * \`\`\`json
 * {
 *   "kind": "cat",
 *   "value": {
 *     "name": "Whiskers",
 *     "meow": true
 *   }
 * },
 * {
 *   "kind": "dog",
 *   "value": {
 *     "name": "Rex",
 *     "bark": false
 *   }
 * }
 * \`\`\`
 *
 * @example Custom property names
 *
 * \`\`\`typespec
 * @discriminated(#{discriminatorPropertyName: "dataKind", envelopePropertyName: "data"})
 * union Pet{ cat: Cat, dog: Dog }
 *
 * model Cat { name: string, meow: boolean }
 * model Dog { name: string, bark: boolean }
 * \`\`\`
 * Serialized as:
 * \`\`\`json
 * {
 *   "dataKind": "cat",
 *   "data": {
 *     "name": "Whiskers",
 *     "meow": true
 *   }
 * },
 * {
 *   "dataKind": "dog",
 *   "data": {
 *     "name": "Rex",
 *     "bark": false
 *   }
 * }
 * \`\`\`
 */
extern dec discriminated(target: Union, options?: valueof DiscriminatedOptions);

/**
 * Specify the property to be used to discriminate this type.
 * @param propertyName The property name to use for discrimination
 *
 * @example
 *
 * \`\`\`typespec
 * @discriminator("kind")
 * model Pet{ kind: string }
 *
 * model Cat extends Pet {kind: "cat", meow: boolean}
 * model Dog extends Pet  {kind: "dog", bark: boolean}
 * \`\`\`
 */
extern dec discriminator(target: Model, propertyName: valueof string);

/**
 * Known encoding to use on utcDateTime or offsetDateTime
 */
enum DateTimeKnownEncoding {
  /**
   * RFC 3339 standard. https://www.ietf.org/rfc/rfc3339.txt
   * Encode to string.
   */
  rfc3339: "rfc3339",

  /**
   * RFC 7231 standard. https://www.ietf.org/rfc/rfc7231.txt
   * Encode to string.
   */
  rfc7231: "rfc7231",

  /**
   * Encode a datetime to a unix timestamp.
   * Unix timestamps are represented as an integer number of seconds since the Unix epoch and usually encoded as an int32.
   */
  unixTimestamp: "unixTimestamp",
}

/**
 * Known encoding to use on duration
 */
enum DurationKnownEncoding {
  /**
   * ISO8601 duration
   */
  ISO8601: "ISO8601",

  /**
   * Encode to integer or float as seconds
   */
  seconds: "seconds",

  /**
   * Encode to integer or float as milliseconds
   */
  milliseconds: "milliseconds",
}

/**
 * Known encoding to use on bytes
 */
enum BytesKnownEncoding {
  /**
   * Encode to Base64
   */
  base64: "base64",

  /**
   * Encode to Base64 Url
   */
  base64url: "base64url",
}

/**
 * Encoding for serializing arrays
 */
enum ArrayEncoding {
  /**
   * Each value of the array is separated by a pipe character (|).
   * Values can only contain | if the underlying protocol supports encoding them.
   * - json -> error
   * - http -> %7C
   */
  pipeDelimited,

  /**
   * Each value of the array is separated by a space character.
   * Values can only contain spaces if the underlying protocol supports encoding them.
   * - json -> error
   * - http -> %20
   */
  spaceDelimited,

  /**
   * Each value of the array is separated by a comma (,).
   * Values can only contain commas if the underlying protocol supports encoding them.
   * - json -> error
   * - http -> %2C
   */
  commaDelimited,

  /**
   * Each value of the array is separated by a newline character (\\n).
   * Values can only contain newlines if the underlying protocol supports encoding them.
   * - json -> error
   * - http -> %0A
   */
  newlineDelimited,
}

/**
 * Specify how to encode the target type.
 * @param encodingOrEncodeAs Known name of an encoding or a scalar type to encode as(Only for numeric types to encode as string).
 * @param encodedAs What target type is this being encoded as. Default to string.
 *
 * @example offsetDateTime encoded with rfc7231
 *
 * \`\`\`tsp
 * @encode("rfc7231")
 * scalar myDateTime extends offsetDateTime;
 * \`\`\`
 *
 * @example utcDateTime encoded with unixTimestamp
 *
 * \`\`\`tsp
 * @encode("unixTimestamp", int32)
 * scalar myDateTime extends unixTimestamp;
 * \`\`\`
 *
 * @example encode numeric type to string
 *
 * \`\`\`tsp
 * model Pet {
 *   @encode(string) id: int64;
 * }
 * \`\`\`
 */
extern dec encode(
  target: Scalar | ModelProperty,
  encodingOrEncodeAs: (valueof string | EnumMember) | Scalar,
  encodedAs?: Scalar
);

/** Options for example decorators */
model ExampleOptions {
  /** The title of the example */
  title?: string;

  /** Description of the example */
  description?: string;
}

/**
 * Provide an example value for a data type.
 *
 * @param example Example value.
 * @param options Optional metadata for the example.
 *
 * @example
 *
 * \`\`\`tsp
 * @example(#{name: "Fluffy", age: 2})
 * model Pet {
 *  name: string;
 *  age: int32;
 * }
 * \`\`\`
 */
extern dec example(
  target: Model | Enum | Scalar | Union | ModelProperty | UnionVariant,
  example: valueof unknown,
  options?: valueof ExampleOptions
);

/**
 * Operation example configuration.
 */
model OperationExample {
  /** Example request body. */
  parameters?: unknown;

  /** Example response body. */
  returnType?: unknown;
}

/**
 * Provide example values for an operation's parameters and corresponding return type.
 *
 * @param example Example value.
 * @param options Optional metadata for the example.
 *
 * @example
 *
 * \`\`\`tsp
 * @opExample(#{parameters: #{name: "Fluffy", age: 2}, returnType: #{name: "Fluffy", age: 2, id: "abc"})
 * op createPet(pet: Pet): Pet;
 * \`\`\`
 */
extern dec opExample(
  target: Operation,
  example: valueof OperationExample,
  options?: valueof ExampleOptions
);

/**
 * Returns the model with required properties removed.
 */
extern dec withOptionalProperties(target: Model);

/**
 * Returns the model with any default values removed.
 */
extern dec withoutDefaultValues(target: Model);

/**
 * Returns the model with the given properties omitted.
 * @param omit List of properties to omit
 */
extern dec withoutOmittedProperties(target: Model, omit: string | Union);

/**
 * Returns the model with only the given properties included.
 * @param pick List of properties to include
 */
extern dec withPickedProperties(target: Model, pick: string | Union);

//---------------------------------------------------------------------------
// Paging
//---------------------------------------------------------------------------

/**
 * Mark this operation as a \`list\` operation that returns a paginated list of items.
 */
extern dec list(target: Operation);

/**
 * Pagination property defining the number of items to skip.
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 * }
 * @list op listPets(@offset skip: int32, @pageSize pageSize: int8): Page<Pet>;
 * \`\`\`
 */
extern dec offset(target: ModelProperty);

/**
 * Pagination property defining the page index.
 *
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 * }
 * @list op listPets(@pageIndex page: int32, @pageSize pageSize: int8): Page<Pet>;
 * \`\`\`
 */
extern dec pageIndex(target: ModelProperty);

/**
 * Specify the pagination parameter that controls the maximum number of items to include in a page.
 *
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 * }
 * @list op listPets(@pageIndex page: int32, @pageSize pageSize: int8): Page<Pet>;
 * \`\`\`
 */
extern dec pageSize(target: ModelProperty);

/**
 * Specify the the property that contains the array of page items.
 *
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 * }
 * @list op listPets(@pageIndex page: int32, @pageSize pageSize: int8): Page<Pet>;
 * \`\`\`
 */
extern dec pageItems(target: ModelProperty);

/**
 * Pagination property defining the token to get to the next page.
 * It MUST be specified both on the request parameter and the response.
 *
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 *   @continuationToken continuationToken: string;
 * }
 * @list op listPets(@continuationToken continuationToken: string): Page<Pet>;
 * \`\`\`
 */
extern dec continuationToken(target: ModelProperty);

/**
 * Pagination property defining a link to the next page.
 *
 * It is expected that navigating to the link will return the same set of responses as the operation that returned the current page.
 *
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 *   @nextLink next: url;
 *   @prevLink prev: url;
 *   @firstLink first: url;
 *   @lastLink last: url;
 * }
 * @list op listPets(): Page<Pet>;
 * \`\`\`
 */
extern dec nextLink(target: ModelProperty);

/**
 * Pagination property defining a link to the previous page.
 *
 * It is expected that navigating to the link will return the same set of responses as the operation that returned the current page.
 *
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 *   @nextLink next: url;
 *   @prevLink prev: url;
 *   @firstLink first: url;
 *   @lastLink last: url;
 * }
 * @list op listPets(): Page<Pet>;
 * \`\`\`
 */
extern dec prevLink(target: ModelProperty);

/**
 * Pagination property defining a link to the first page.
 *
 * It is expected that navigating to the link will return the same set of responses as the operation that returned the current page.
 *
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 *   @nextLink next: url;
 *   @prevLink prev: url;
 *   @firstLink first: url;
 *   @lastLink last: url;
 * }
 * @list op listPets(): Page<Pet>;
 * \`\`\`
 */
extern dec firstLink(target: ModelProperty);

/**
 * Pagination property defining a link to the last page.
 *
 * It is expected that navigating to the link will return the same set of responses as the operation that returned the current page.
 *
 * @example
 * \`\`\`tsp
 * model Page<T> {
 *   @pageItems items: T[];
 *   @nextLink next: url;
 *   @prevLink prev: url;
 *   @firstLink first: url;
 *   @lastLink last: url;
 * }
 * @list op listPets(): Page<Pet>;
 * \`\`\`
 */
extern dec lastLink(target: ModelProperty);

//---------------------------------------------------------------------------
// Debugging
//---------------------------------------------------------------------------

/**
 * A debugging decorator used to inspect a type.
 * @param text Custom text to log
 */
extern dec inspectType(target: unknown, text: valueof string);

/**
 * A debugging decorator used to inspect a type name.
 * @param text Custom text to log
 */
extern dec inspectTypeName(target: unknown, text: valueof string);
`,"../../../../../../src/typespec/core/packages/compiler/lib/std/reflection.tsp":`namespace TypeSpec.Reflection;

model Enum {}
model EnumMember {}
model Interface {}
model Model {}
model ModelProperty {}
model Namespace {}
model Operation {}
model Scalar {}
model Union {}
model UnionVariant {}
model StringTemplate {}
`,"../../../../../../src/typespec/core/packages/compiler/lib/std/visibility.tsp":`// Copyright (c) Microsoft Corporation
// Licensed under the MIT license.

import "../../dist/src/lib/tsp-index.js";

using TypeSpec.Reflection;

namespace TypeSpec;

/**
 * Sets the visibility modifiers that are active on a property, indicating that it is only considered to be present
 * (or "visible") in contexts that select for the given modifiers.
 *
 * A property without any visibility settings applied for any visibility class (e.g. \`Lifecycle\`) is considered to have
 * the default visibility settings for that class.
 *
 * If visibility for the property has already been set for a visibility class (for example, using \`@invisible\` or
 * \`@removeVisibility\`), this decorator will **add** the specified visibility modifiers to the property.
 *
 * See: [Visibility](https://typespec.io/docs/language-basics/visibility)
 *
 * The \`@typespec/http\` library uses \`Lifecycle\` visibility to determine which properties are included in the request or
 * response bodies of HTTP operations. By default, it uses the following visibility settings:
 *
 * - For the return type of operations, properties are included if they have \`Lifecycle.Read\` visibility.
 * - For POST operation parameters, properties are included if they have \`Lifecycle.Create\` visibility.
 * - For PUT operation parameters, properties are included if they have \`Lifecycle.Create\` or \`Lifecycle.Update\` visibility.
 * - For PATCH operation parameters, properties are included if they have \`Lifecycle.Update\` visibility.
 * - For DELETE operation parameters, properties are included if they have \`Lifecycle.Delete\` visibility.
 * - For GET or HEAD operation parameters, properties are included if they have \`Lifecycle.Query\` visibility.
 *
 * By default, properties have all five Lifecycle visibility modifiers enabled, so a property is visible in all contexts
 * by default.
 *
 * The default settings may be overridden using the \`@returnTypeVisibility\` and \`@parameterVisibility\` decorators.
 *
 * See also: [Automatic visibility](https://typespec.io/docs/libraries/http/operations#automatic-visibility)
 *
 * @param visibilities List of visibilities which apply to this property.
 *
 * @example
 *
 * \`\`\`typespec
 * model Dog {
 *   // The service will generate an ID, so you don't need to send it.
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   // The service will store this secret name, but won't ever return it.
 *   @visibility(Lifecycle.Create, Lifecycle.Update)
 *   secretName: string;
 *
 *   // The regular name has all vi
 *   name: string;
 * }
 * \`\`\`
 */
extern dec visibility(target: ModelProperty, ...visibilities: valueof EnumMember[]);

/**
 * Indicates that a property is not visible in the given visibility class.
 *
 * This decorator removes all active visibility modifiers from the property within
 * the given visibility class, making it invisible to any context that selects for
 * visibility modifiers within that class.
 *
 * @param visibilityClass The visibility class to make the property invisible within.
 *
 * @example
 * \`\`\`typespec
 * model Example {
 *   @invisible(Lifecycle)
 *   hidden_property: string;
 * }
 * \`\`\`
 */
extern dec invisible(target: ModelProperty, visibilityClass: Enum);

/**
 * Removes visibility modifiers from a property.
 *
 * If the visibility modifiers for a visibility class have not been initialized,
 * this decorator will use the default visibility modifiers for the visibility
 * class as the default modifier set.
 *
 * @param target The property to remove visibility from.
 * @param visibilities The visibility modifiers to remove from the target property.
 *
 * @example
 * \`\`\`typespec
 * model Example {
 *   // This property will have all Lifecycle visibilities except the Read
 *   // visibility, since it is removed.
 *   @removeVisibility(Lifecycle.Read)
 *   secret_property: string;
 * }
 * \`\`\`
 */
extern dec removeVisibility(target: ModelProperty, ...visibilities: valueof EnumMember[]);

/**
 * Removes properties that do not have at least one of the given visibility modifiers
 * active.
 *
 * If no visibility modifiers are supplied, this decorator has no effect.
 *
 * See also: [Automatic visibility](https://typespec.io/docs/libraries/http/operations#automatic-visibility)
 *
 * When using an emitter that applies visibility automatically, it is generally
 * not necessary to use this decorator.
 *
 * @param visibilities List of visibilities that apply to this property.
 *
 * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   @visibility(Lifecycle.Create, Lifecycle.Update)
 *   secretName: string;
 *
 *   name: string;
 * }
 *
 * // The spread operator will copy all the properties of Dog into DogRead,
 * // and @withVisibility will then remove those that are not visible with
 * // create or update visibility.
 * //
 * // In this case, the id property is removed, and the name and secretName
 * // properties are kept.
 * @withVisibility(Lifecycle.Create, Lifecycle.Update)
 * model DogCreateOrUpdate {
 *   ...Dog;
 * }
 *
 * // In this case the id and name properties are kept and the secretName property
 * // is removed.
 * @withVisibility(Lifecycle.Read)
 * model DogRead {
 *   ...Dog;
 * }
 * \`\`\`
 */
extern dec withVisibility(target: Model, ...visibilities: valueof EnumMember[]);

/**
 * Set the visibility of key properties in a model if not already set.
 *
 * This will set the visibility modifiers of all key properties in the model if the visibility is not already _explicitly_ set,
 * but will not change the visibility of any properties that have visibility set _explicitly_, even if the visibility
 * is the same as the default visibility.
 *
 * Visibility may be set explicitly using any of the following decorators:
 *
 * - \`@visibility\`
 * - \`@removeVisibility\`
 * - \`@invisible\`
 *
 * @param visibility The desired default visibility value. If a key property already has visibility set, it will not be changed.
 */
extern dec withDefaultKeyVisibility(target: Model, visibility: valueof EnumMember);

/**
 * Declares the visibility constraint of the parameters of a given operation.
 *
 * A parameter or property nested within a parameter will be visible if it has _any_ of the visibilities
 * in the list.
 *
 * It is invalid to call this decorator with no visibility modifiers.
 *
 * @param visibilities List of visibility modifiers that apply to the parameters of this operation.
 */
extern dec parameterVisibility(target: Operation, ...visibilities: valueof EnumMember[]);

/**
 * Declares the visibility constraint of the return type of a given operation.
 *
 * A property within the return type of the operation will be visible if it has _any_ of the visibilities
 * in the list.
 *
 * It is invalid to call this decorator with no visibility modifiers.
 *
 * @param visibilities List of visibility modifiers that apply to the return type of this operation.
 */
extern dec returnTypeVisibility(target: Operation, ...visibilities: valueof EnumMember[]);

/**
 * Returns the model with non-updateable properties removed.
 */
extern dec withUpdateableProperties(target: Model);

/**
 * Declares the default visibility modifiers for a visibility class.
 *
 * The default modifiers are used when a property does not have any visibility decorators
 * applied to it.
 *
 * The modifiers passed to this decorator _MUST_ be members of the target Enum.
 *
 * @param visibilities the list of modifiers to use as the default visibility modifiers.
 */
extern dec defaultVisibility(target: Enum, ...visibilities: valueof EnumMember[]);

/**
 * A visibility class for resource lifecycle phases.
 *
 * These visibilities control whether a property is visible during the various phases of a resource's lifecycle.
 *
 * @example
 * \`\`\`typespec
 * model Dog {
 *  @visibility(Lifecycle.Read)
 *  id: int32;
 *
 *  @visibility(Lifecycle.Create, Lifecycle.Update)
 *  secretName: string;
 *
 *  name: string;
 * }
 * \`\`\`
 *
 * In this example, the \`id\` property is only visible during the read phase, and the \`secretName\` property is only visible
 * during the create and update phases. This means that the server will return the \`id\` property when returning a \`Dog\`,
 * but the client will not be able to set or update it. In contrast, the \`secretName\` property can be set when creating
 * or updating a \`Dog\`, but the server will never return it. The \`name\` property has no visibility modifiers and is
 * therefore visible in all phases.
 */
enum Lifecycle {
  /**
   * The property is visible when a resource is being created.
   */
  Create,

  /**
   * The property is visible when a resource is being read.
   */
  Read,

  /**
   * The property is visible when a resource is being updated.
   */
  Update,

  /**
   * The property is visible when a resource is being deleted.
   */
  Delete,

  /**
   * The property is visible when a resource is being queried.
   *
   * In HTTP APIs, this visibility applies to parameters of GET or HEAD operations.
   */
  Query,
}

/**
 * A visibility filter, used to specify which properties should be included when
 * using the \`withVisibilityFilter\` decorator.
 *
 * The filter matches any property with ALL of the following:
 * - If the \`any\` key is present, the property must have at least one of the specified visibilities.
 * - If the \`all\` key is present, the property must have all of the specified visibilities.
 * - If the \`none\` key is present, the property must have none of the specified visibilities.
 */
model VisibilityFilter {
  any?: EnumMember[];
  all?: EnumMember[];
  none?: EnumMember[];
}

/**
 * Applies the given visibility filter to the properties of the target model.
 *
 * This transformation is recursive, so it will also apply the filter to any nested
 * or referenced models that are the types of any properties in the \`target\`.
 *
 * If a \`nameTemplate\` is provided, newly-created type instances will be named according
 * to the template. See the \`@friendlyName\` decorator for more information on the template
 * syntax. The transformed type is provided as the argument to the template.
 *
 * @param target The model to apply the visibility filter to.
 * @param filter The visibility filter to apply to the properties of the target model.
 * @param nameTemplate The name template to use when renaming new model instances.
 *
 * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   name: string;
 * }
 *
 * @withVisibilityFilter(#{ all: #[Lifecycle.Read] })
 * model DogRead {
 *  ...Dog
 * }
 * \`\`\`
 */
#deprecated "withVisibilityFilter is deprecated and will be removed in a future release. Use the \`FilterVisibility\` template or Lifecycle specific templates (e.g. \`Read\`, \`Create\`, \`Update\`, etc.) instead."
extern dec withVisibilityFilter(
  target: Model,
  filter: valueof VisibilityFilter,
  nameTemplate?: valueof string
);

/**
 * A copy of the input model \`M\` with only the properties that match the given visibility filter.
 *
 * This transformation is recursive, so it will also apply the filter to any nested
 * or referenced models that are the types of any properties in the \`target\`.
 *
 * If a \`nameTemplate\` is provided, newly-created type instances will be named according
 * to the template. See the \`@friendlyName\` decorator for more information on the template
 * syntax. The transformed type is provided as the argument to the template.
 *
 * @template M the model to apply the visibility filter to.
 * @template Filter the visibility filter to apply to the properties of the target model.
 * @template NameTemplate the name template to use when renaming new type instances.
 *
 * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(CustomVisibility.A)
 *   id: int32;
 *   @removeVisibility(CustomVisibility.A)
 *   name: string;
 * }
 *
 * enum CustomVisibility {
 *   A,
 *   B,
 * }
 *
 * const customFilter: VisibilityFilter = #{ all: #[CustomVisibility.A] };
 *
 * // This model will have the \`id\` property but not the \`name\` property, since \`id\` has the CustomVisibility.A visibility and \`name\` does not.
 * model DogRead is FilterVisibility<Dog, customFilter, "Read{name}">;
 * \`\`\`
 */
alias FilterVisibility<
  M extends Model,
  Filter extends valueof VisibilityFilter,
  NameTemplate extends valueof string
> = applyVisibilityFilter(M, Filter, NameTemplate);

#suppress "experimental-feature"
internal extern fn applyVisibilityFilter(
  input: Model,
  filter: valueof VisibilityFilter,
  nameTemplate?: valueof string
): Model;

/**
 * Transforms the \`target\` model to include only properties that are visible during the
 * "Update" lifecycle phase.
 *
 * Any nested models of optional properties will be transformed into the "CreateOrUpdate"
 * lifecycle phase instead of the "Update" lifecycle phase, so that nested models may be
 * fully updated.
 *
 * If a \`nameTemplate\` is provided, newly-created type instances will be named according
 * to the template. See the \`@friendlyName\` decorator for more information on the template
 * syntax. The transformed type is provided as the argument to the template.
 *
 * @param target The model to apply the transformation to.
 * @param nameTemplate The name template to use when renaming new model instances.
 *
 * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   @visibility(Lifecycle.Create, Lifecycle.Update)
 *   secretName: string;
 *
 *   name: string;
 * }
 *
 * @withLifecycleUpdate
 * model DogUpdate {
 *   ...Dog
 * }
 * \`\`\`
 */
#deprecated "withLifecycleUpdate is deprecated and will be removed in a future release. Use the \`Update\` template instead."
extern dec withLifecycleUpdate(target: Model, nameTemplate?: valueof string);

#suppress "experimental-feature"
internal extern fn applyLifecycleUpdate(input: Model, nameTemplate?: valueof string): Model;

/**
 * A copy of the input model \`T\` with only the properties that are visible during the
 * "Create" resource lifecycle phase.
 *
 * This transformation is recursive, and will include only properties that have the
 * \`Lifecycle.Create\` visibility modifier.
 *
 * If a \`NameTemplate\` is provided, the new model will be named according to the template.
 * The template uses the same syntax as the \`@friendlyName\` decorator.
 *
 * @template T The model to transform.
 * @template NameTemplate The name template to use for the new model.
 *
 *  * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   name: string;
 * }
 *
 * // This model has only the \`name\` field.
 * model CreateDog is Create<Dog>;
 * \`\`\`
 */
alias Create<
  T extends Model,
  NameTemplate extends valueof string = "Create{name}"
> = applyVisibilityFilter(T, #{ all: #[Lifecycle.Create] }, NameTemplate);

/**
 * A copy of the input model \`T\` with only the properties that are visible during the
 * "Read" resource lifecycle phase.
 *
 * The "Read" lifecycle phase is used for properties returned by operations that read data, like
 * HTTP GET operations.
 *
 * This transformation is recursive, and will include only properties that have the
 * \`Lifecycle.Read\` visibility modifier.
 *
 * If a \`NameTemplate\` is provided, the new model will be named according to the template.
 * The template uses the same syntax as the \`@friendlyName\` decorator.
 *
 * @template T The model to transform.
 * @template NameTemplate The name template to use for the new model.
 *
 *  * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   @visibility(Lifecycle.Create, Lifecycle.Update)
 *   secretName: string;
 *
 *   name: string;
 * }
 *
 * // This model has the \`id\` and \`name\` fields, but not \`secretName\`.
 * model ReadDog is Read<Dog>;
 * \`\`\`
 */
alias Read<
  T extends Model,
  NameTemplate extends valueof string = "Read{name}"
> = applyVisibilityFilter(T, #{ all: #[Lifecycle.Read] }, NameTemplate);

/**
 * A copy of the input model \`T\` with only the properties that are visible during the
 * "Update" resource lifecycle phase.
 *
 * The "Update" lifecycle phase is used for properties passed as parameters to operations
 * that update data, like HTTP PATCH operations.
 *
 * This transformation will include only the properties that have the \`Lifecycle.Update\`
 * visibility modifier, and the types of all properties will be replaced with the
 * equivalent \`CreateOrUpdate\` transformation.
 *
 * If a \`NameTemplate\` is provided, the new model will be named according to the template.
 * The template uses the same syntax as the \`@friendlyName\` decorator.
 *
 * @template T The model to transform.
 * @template NameTemplate The name template to use for the new model.
 *
 *  * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   @visibility(Lifecycle.Create, Lifecycle.Update)
 *   secretName: string;
 *
 *   name: string;
 * }
 *
 * // This model will have the \`secretName\` and \`name\` fields, but not the \`id\` field.
 * model UpdateDog is Update<Dog>;
 * \`\`\`
 */
alias Update<
  T extends Model,
  NameTemplate extends valueof string = "Update{name}"
> = applyLifecycleUpdate(T, NameTemplate);

/**
 * A copy of the input model \`T\` with only the properties that are visible during the
 * "Create" or "Update" resource lifecycle phases.
 *
 * The "CreateOrUpdate" lifecycle phase is used by default for properties passed as parameters to operations
 * that can create _or_ update data, like HTTP PUT operations.
 *
 * This transformation is recursive, and will include only properties that have the
 * \`Lifecycle.Create\` or \`Lifecycle.Update\` visibility modifier.
 *
 * If a \`NameTemplate\` is provided, the new model will be named according to the template.
 * The template uses the same syntax as the \`@friendlyName\` decorator.
 *
 * @template T The model to transform.
 * @template NameTemplate The name template to use for the new model.
 *
 *  * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   @visibility(Lifecycle.Create)
 *   immutableSecret: string;
 *
 *   @visibility(Lifecycle.Create, Lifecycle.Update)
 *   secretName: string;
 *
 *   name: string;
 * }
 *
 * // This model will have the \`immutableSecret\`, \`secretName\`, and \`name\` fields, but not the \`id\` field.
 * model CreateOrUpdateDog is CreateOrUpdate<Dog>;
 * \`\`\`
 */
alias CreateOrUpdate<
  T extends Model,
  NameTemplate extends valueof string = "CreateOrUpdate{name}"
> = applyVisibilityFilter(T, #{ any: #[Lifecycle.Create, Lifecycle.Update] }, NameTemplate);

/**
 * A copy of the input model \`T\` with only the properties that are visible during the
 * "Delete" resource lifecycle phase.
 *
 * The "Delete" lifecycle phase is used for properties passed as parameters to operations
 * that delete data, like HTTP DELETE operations.
 *
 * This transformation is recursive, and will include only properties that have the
 * \`Lifecycle.Delete\` visibility modifier.
 *
 * If a \`NameTemplate\` is provided, the new model will be named according to the template.
 * The template uses the same syntax as the \`@friendlyName\` decorator.
 *
 * @template T The model to transform.
 * @template NameTemplate The name template to use for the new model.
 *
 *  * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   // Set when the Dog is removed from our data store. This happens when the
 *   // Dog is re-homed to a new owner.
 *   @visibility(Lifecycle.Delete)
 *   nextOwner: string;
 *
 *   name: string;
 * }
 *
 * // This model will have the \`nextOwner\` and \`name\` fields, but not the \`id\` field.
 * model DeleteDog is Delete<Dog>;
 * \`\`\`
 */
alias Delete<
  T extends Model,
  NameTemplate extends valueof string = "Delete{name}"
> = applyVisibilityFilter(T, #{ all: #[Lifecycle.Delete] }, NameTemplate);

/**
 * A copy of the input model \`T\` with only the properties that are visible during the
 * "Query" resource lifecycle phase.
 *
 * The "Query" lifecycle phase is used for properties passed as parameters to operations
 * that read data, like HTTP GET or HEAD operations. This should not be confused for
 * the \`@query\` decorator, which specifies that the property is transmitted in the
 * query string of an HTTP request.
 *
 * This transformation is recursive, and will include only properties that have the
 * \`Lifecycle.Query\` visibility modifier.
 *
 * If a \`NameTemplate\` is provided, the new model will be named according to the template.
 * The template uses the same syntax as the \`@friendlyName\` decorator.
 *
 * @template T The model to transform.
 * @template NameTemplate The name template to use for the new model.
 *
 *  * @example
 * \`\`\`typespec
 * model Dog {
 *   @visibility(Lifecycle.Read)
 *   id: int32;
 *
 *   // When getting information for a Dog, you can set this field to true to include
 *   // some extra information about the Dog's pedigree that is normally not returned.
 *   // Alternatively, you could just use a separate option parameter to get this
 *   // information.
 *   @visibility(Lifecycle.Query)
 *   includePedigree?: boolean;
 *
 *   name: string;
 *
 *   // Only included if \`includePedigree\` is set to true in the request.
 *   @visibility(Lifecycle.Read)
 *   pedigree?: string;
 * }
 *
 * // This model will have the \`includePedigree\` and \`name\` fields, but not \`id\` or \`pedigree\`.
 * model QueryDog is Query<Dog>;
 * \`\`\`
 */
alias Query<
  T extends Model,
  NameTemplate extends valueof string = "Query{name}"
> = applyVisibilityFilter(T, #{ all: #[Lifecycle.Query] }, NameTemplate);
`,"lib/main.tsp":`import "@azure-tools/typespec-autorest";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/rest";
import "@typespec/openapi";
import "@typespec/versioning";

using Azure.ResourceManager;
using TypeSpec.Versioning;
using TypeSpec.Reflection;
using TypeSpec.OpenAPI;

@versioned(LiftrBase.Versions)
namespace LiftrBase;

@doc("Supported versions for LiftrBase resource model")
enum Versions {
  @doc("Dependent on Azure.ResourceManager.Versions.v1_0_Preview_1")
  @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
  @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
  v1_preview: "2023-06-01-preview",

  @doc("Dependent on Azure.ResourceManager.Versions.v1_0_Preview_1")
  @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
  @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
  v2_preview: "2025-01-15-preview",

  @doc("Dependent on Azure.ResourceManager.Versions.v1_0_Preview_1")
  @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
  @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
  v2024_08_27_preview: "2024-08-27-preview",

  @doc("Dependent on Azure.ResourceManager.Versions.v1_0_Preview_1")
  @useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
  @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
  v2024_08_27: "2024-08-27",
}

@doc("Marketplace subscription status of a resource.")
union MarketplaceSubscriptionStatus {
  @doc("Purchased but not yet activated")
  PendingFulfillmentStart: "PendingFulfillmentStart",

  @doc("Marketplace subscription is activated")
  Subscribed: "Subscribed",

  @doc("This state indicates that a customer's payment for the Marketplace service was not received")
  Suspended: "Suspended",

  @doc("Customer has cancelled the subscription")
  Unsubscribed: "Unsubscribed",

  string,
}

@added(Versions.v2024_08_27_preview)
@added(Versions.v2024_08_27)
@doc("Subscription renewal mode")
union RenewalMode {
  string,

  @doc("Automatic renewal")
  Auto: "Auto",

  @doc("Manual renewal")
  Manual: "Manual",
}

@doc("A string that represents a URI.")
scalar Uri extends string;

@doc("Marketplace details for an organization")
model MarketplaceDetails {
  @madeOptional(Versions.v2_preview)
  @doc("Azure subscription id for the the marketplace offer is purchased from")
  subscriptionId?: string;

  @doc("Marketplace subscription status")
  @visibility(Lifecycle.Read)
  subscriptionStatus?: MarketplaceSubscriptionStatus;

  @doc("Offer details for the marketplace that is selected by the user")
  offerDetails: OfferDetails;
}

@doc("Offer details for the marketplace that is selected by the user")
model OfferDetails {
  @doc("Publisher Id for the marketplace offer")
  publisherId: string;

  @doc("Offer Id for the marketplace offer")
  offerId: string;

  @doc("Plan Id for the marketplace offer")
  planId: string;

  @doc("Plan Name for the marketplace offer")
  planName?: string;

  @doc("Plan Display Name for the marketplace offer")
  termUnit?: string;

  @doc("Plan Display Name for the marketplace offer")
  termId?: string;

  @added(Versions.v2024_08_27_preview)
  @added(Versions.v2024_08_27)
  @doc("Subscription renewal mode")
  renewalMode?: RenewalMode;

  @added(Versions.v2024_08_27_preview)
  @added(Versions.v2024_08_27)
  @doc("Current subscription end date and time")
  @visibility(Lifecycle.Read)
  endDate?: utcDateTime;
}

@doc("Reusable representation of an email address.")
@pattern("^[A-Za-z0-9._%+-]+@(?:[A-Za-z0-9-]+\\\\.)+[A-Za-z]{2,}$")
scalar email extends string;

@doc("User details for an organization")
model UserDetails {
  @madeOptional(Versions.v2_preview)
  @doc("First name of the user")
  firstName?: string;

  @madeOptional(Versions.v2_preview)
  @doc("Last name of the user")
  lastName?: string;

  @madeOptional(Versions.v2_preview)
  @doc("Email address of the user")
  emailAddress?: email;

  @doc("User's principal name")
  upn?: string;

  @doc("User's phone number")
  phoneNumber?: string;
}

@doc("Base resource properties that can be extended for arm resources.")
model BaseResourceProperties {
  @doc("Marketplace details of the resource.")
  @visibility(Lifecycle.Create, Lifecycle.Read, Lifecycle.Update)
  marketplace: MarketplaceDetails;

  @doc("Details of the user.")
  user: UserDetails;

  @doc("Provisioning state of the resource.")
  @visibility(Lifecycle.Read)
  provisioningState?: ResourceProvisioningState;
}

@doc("Properties specific to Single Sign On Resource")
model SingleSignOnProperties {
  @doc("State of the Single Sign On for the organization")
  singleSignOnState?: SingleSignOnStates;

  @doc("AAD enterprise application Id used to setup SSO")
  enterpriseAppId?: string;

  @doc("URL for SSO to be used by the partner to redirect the user to their system")
  singleSignOnUrl?: Uri;

  @doc("List of AAD domains fetched from Microsoft Graph for user.")
  aadDomains?: string[];

  @visibility(Lifecycle.Read)
  @doc("Provisioning State of the resource")
  provisioningState?: ResourceProvisioningState;
}

@doc("Properties specific to Single Sign On Resource")
model SingleSignOnPropertiesV2 {
  @doc("Type of Single Sign-On mechanism being used")
  type: SingleSignOnType;

  @doc("State of the Single Sign On for the resource")
  state?: SingleSignOnStates;

  @doc("AAD enterprise application Id used to setup SSO")
  enterpriseAppId?: string;

  @doc("URL for SSO to be used by the partner to redirect the user to their system")
  url?: Uri;

  @doc("List of AAD domains fetched from Microsoft Graph for user.")
  aadDomains?: string[];
}

@doc("Various states of the SSO resource")
union SingleSignOnStates {
  @doc("Initial state of the SSO resource")
  Initial: "Initial",

  @doc("State of the SSO resource when it is enabled")
  Enable: "Enable",

  @doc("State of the SSO resource when it is disabled")
  Disable: "Disable",

  string,
}

@doc("Defines the type of Single Sign-On (SSO) mechanism being used")
union SingleSignOnType {
  @doc("Security Assertion Markup Language (SAML) based Single Sign-On")
  Saml: "Saml",

  @doc("OpenID Connect based Single Sign-On.")
  OpenId: "OpenId",

  string,
}
`,"../../../../../../src/typespec/packages/typespec-autorest/lib/autorest.tsp":`import "./decorators.tsp";
import "../dist/src/tsp-index.js";
`,"../../../../../../src/typespec/packages/typespec-autorest/lib/decorators.tsp":`using Reflection;

namespace Autorest;

/**
 * \`@example\` - attaches example files to an operation. Multiple examples can be specified.
 *
 * \`@example\` can be specified on Operations.
 *
 * @param pathOrUri - path or Uri to the example file.
 * @param title - name or description of the example file.
 */
extern dec example(target: Operation, pathOrUri: valueof string, title: valueof string);

/**
 * \`@useRef\` - is used to replace the TypeSpec model type in emitter output with a pre-existing named OpenAPI schema such as Azure Resource Manager common types.
 *
 * \`@useRef\` can be specified on Models and ModelProperty.
 *
 * @param jsonRef - path or Uri to an OpenAPI schema.
 */
extern dec useRef(entity: Model | ModelProperty, jsonRef: valueof string);
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/azure-core.tsp":`import "@typespec/http";
import "@typespec/rest";

import "./auth.tsp";
import "./traits.tsp";
import "./foundations.tsp";
import "./models.tsp";
import "./operations.tsp";
import "./obsolete.tsp";
import "./decorators.tsp";
import "./legacy.tsp";
import "../dist/src/tsp-index.js";

namespace Azure.Core;
`,"../../../../../../src/typespec/core/packages/http/lib/main.tsp":`import "../dist/src/tsp-index.js";
import "./decorators.tsp";
import "./private.decorators.tsp";
import "./auth.tsp";

namespace TypeSpec.Http;

using Private;

/**
 * Describes an HTTP response.
 *
 * @template Status The status code of the response.
 */
@doc("")
model Response<Status> {
  @doc("The status code.")
  @statusCode
  statusCode: Status;
}

/**
 * Defines a model with a single property of the given type, marked with \`@body\`.
 *
 * This can be useful in situations where you cannot use a bare type as the body
 * and it is awkward to add a property.
 *
 * @template Type The type of the model's \`body\` property.
 */
@doc("")
model Body<Type> {
  @body
  @doc("The body type of the operation request or response.")
  body: Type;
}

/**
 * The Location header contains the URL where the status of the long running operation can be checked.
 */
model LocationHeader {
  @doc("The Location header contains the URL where the status of the long running operation can be checked.")
  @header
  location: string;
}

// Don't put @doc on these, change \`getStatusCodeDescription\` implementation
// to update the default descriptions for these status codes. This ensures
// that we get consistent emit between different ways to spell the same
// responses in TypeSpec.

/**
 * The request has succeeded.
 */
model OkResponse is Response<200>;
/**
 * The request has succeeded and a new resource has been created as a result.
 */
model CreatedResponse is Response<201>;
/**
 * The request has been accepted for processing, but processing has not yet completed.
 */
model AcceptedResponse is Response<202>;
/**
 * There is no content to send for this request, but the headers may be useful.
 */
model NoContentResponse is Response<204>;
/**
 * The URL of the requested resource has been changed permanently. The new URL is given in the response.
 */
model MovedResponse is Response<301> {
  ...LocationHeader;
}
/**
 * The client has made a conditional request and the resource has not been modified.
 */
model NotModifiedResponse is Response<304>;
/**
 * The server could not understand the request due to invalid syntax.
 */
model BadRequestResponse is Response<400>;
/**
 * Access is unauthorized.
 */
model UnauthorizedResponse is Response<401>;
/**
 * Access is forbidden.
 */
model ForbiddenResponse is Response<403>;
/**
 * The server cannot find the requested resource.
 */
model NotFoundResponse is Response<404>;
/**
 * The request conflicts with the current state of the server.
 */
model ConflictResponse is Response<409>;

/**
 * Produces a new model with the same properties as T, but with \`@query\`,
 * \`@header\`, \`@body\`, and \`@path\` decorators removed from all properties.
 *
 * @template Data The model to spread as the plain data.
 */
@plainData
model PlainData<Data> {
  ...Data;
}

/**
 * A file in an HTTP request, response, or multipart payload.
 *
 * Files have a special meaning that the HTTP library understands. When the body of an HTTP request, response,
 * or multipart payload is _effectively_ an instance of \`TypeSpec.Http.File\` or any type that extends it, the
 * operation is treated as a file upload or download.
 *
 * When using file bodies, the fields of the file model are defined to come from particular locations by default:
 *
 * - \`contentType\`: The \`Content-Type\` header of the request, response, or multipart payload (CANNOT be overridden or changed).
 * - \`contents\`: The body of the request, response, or multipart payload (CANNOT be overridden or changed).
 * - \`filename\`: The \`filename\` parameter value of the \`Content-Disposition\` header of the response or multipart payload
 *   (MAY be overridden or changed).
 *
 * A File may be used as a normal structured JSON object in a request or response, if the request specifies an explicit
 * \`Content-Type\` header. In this case, the entire File model is serialized as if it were any other model. In a JSON payload,
 * it will have a structure like:
 *
 * \`\`\`
 * {
 *   "contentType": <string?>,
 *   "filename": <string?>,
 *   "contents": <string, base64>
 * }
 * \`\`\`
 *
 * The \`contentType\` _within_ the file defines what media types the data inside the file can be, but if the specification
 * defines a \`Content-Type\` for the payload as HTTP metadata, that \`Content-Type\` metadata defines _how the file is
 * serialized_. See the examples below for more information.
 *
 * NOTE: The \`filename\` and \`contentType\` fields are optional. Furthermore, the default location of \`filename\`
 * (\`Content-Disposition: <disposition>; filename=<filename>\`) is only valid in HTTP responses and multipart payloads. If
 * you wish to send the \`filename\` in a request, you must use HTTP metadata decorators to describe the location of the
 * \`filename\` field. You can combine the metadata decorators with \`@visibility\` to control when the \`filename\` location
 * is overridden, as shown in the examples below.
 *
 * @template ContentType The allowed media (MIME) types of the file contents.
 * @template Contents The type of the file contents. This can be \`string\`, \`bytes\`, or any scalar that extends them.
 *
 * @example
 * \`\`\`tsp
 * // Download a file
 * @get op download(): File;
 *
 * // Upload a file
 * @post op upload(@bodyRoot file: File): void;
 * \`\`\`
 *
 * @example
 * \`\`\`tsp
 * // Upload and download files in a multipart payload
 * op multipartFormDataUpload(
 *   @multipartBody fields: {
 *     files: HttpPart<File>[];
 *   },
 * ): void;
 *
 * op multipartFormDataDownload(): {
 *   @multipartBody formFields: {
 *     files: HttpPart<File>[];
 *   }
 * };
 * \`\`\`
 *
 * @example
 * \`\`\`tsp
 * // Declare a custom type of text file, where the filename goes in the path
 * // in requests.
 * model SpecFile extends File<"application/json" | "application/yaml", string> {
 *   // Provide a header that contains the name of the file when created or updated
 *   @header("x-filename")
 *   @path filename: string;
 * }
 *
 * @get op downloadSpec(@path name: string): SpecFile;
 *
 * @post op uploadSpec(@bodyRoot spec: SpecFile): void;
 * \`\`\`
 *
 * @example
 * \`\`\`tsp
 * // Declare a custom type of binary file
 * model ImageFile extends File {
 *   contentType: "image/png" | "image/jpeg";
 *   @path filename: string;
 * }
 *
 * @get op downloadImage(@path name: string): ImageFile;
 *
 * @post op uploadImage(@bodyRoot image: ImageFile): void;
 * \`\`\`
 *
 * @example
 * \`\`\`tsp
 * // Use a File as a structured JSON object. The HTTP library will warn you that the File will be serialized as JSON,
 * // so you should suppress the warning if it's really what you want instead of a binary file upload/download.
 *
 * // The response body is a JSON object like \`{"contentType":<string?>,"filename":<string?>,"contents":<string>}\`
 * @get op downloadTextFileJson(): {
 *   @header contentType: "application/json",
 *   @body file: File<"text/plain", string>,
 * };
 *
 * // The request body is a JSON object like \`{"contentType":<string?>,"filename":<string?>,"contents":<base64>}\`
 * @post op uploadBinaryFileJson(
 *   @header contentType: "application/json",
 *   @body file: File<"image/png", bytes>,
 * ): void;
 *
 */
@summary("A file in an HTTP request, response, or multipart payload.")
@Private.httpFile
model File<ContentType extends string = string, Contents extends bytes | string = bytes> {
  /**
   * The allowed media (MIME) types of the file contents.
   *
   * In file bodies, this value comes from the \`Content-Type\` header of the request or response. In JSON bodies,
   * this value is serialized as a field in the response.
   *
   * NOTE: this is not _necessarily_ the same as the \`Content-Type\` header of the request or response, but
   * it will be for file bodies. It may be different if the file is serialized as a JSON object. It always refers to the
   * _contents_ of the file, and not necessarily the way the file itself is transmitted or serialized.
   */
  @summary("The allowed media (MIME) types of the file contents.")
  contentType?: ContentType;

  /**
   * The name of the file, if any.
   *
   * In file bodies, this value comes from the \`filename\` parameter of the \`Content-Disposition\` header of the response
   * or multipart payload. In JSON bodies, this value is serialized as a field in the response.
   *
   * NOTE: By default, \`filename\` cannot be sent in request payloads and can only be sent in responses and multipart
   * payloads, as the \`Content-Disposition\` header is not valid in requests. If you want to send the \`filename\` in a request,
   * you must extend the \`File\` model and override the \`filename\` property with a different location defined by HTTP metadata
   * decorators.
   */
  @summary("The name of the file, if any.")
  filename?: string;

  /**
   * The contents of the file.
   *
   * In file bodies, this value comes from the body of the request, response, or multipart payload. In JSON bodies,
   * this value is serialized as a field in the response.
   */
  @summary("The contents of the file.")
  contents: Contents;
}

model HttpPartOptions {
  /** Name of the part when using the array form. */
  name?: string;
}

@Private.httpPart(Type, Options)
model HttpPart<Type, Options extends valueof HttpPartOptions = #{}> {}

model Link {
  target: url;
  rel: string;
  attributes?: Record<unknown>;
}

scalar LinkHeader<T extends Record<url> | Link[]> extends string;

/**
 * Create a MergePatch Request body for updating the given resource Model.
 * The MergePatch request created by this template provides a TypeSpec description of a
 * JSON MergePatch request that can successfully update the given resource.
 * The transformation follows the definition of JSON MergePatch requests in
 * rfc 7396: https://www.rfc-editor.org/rfc/rfc7396,
 * applying the merge-patch transform recursively to keyed types in the resource Model.
 *
 * Using this template in a PATCH request body overrides the \`implicitOptionality\`
 * setting for PATCH operations and sets \`application/merge-patch+json\` as the request
 * content-type.
 *
 * @template T The type of the resource to create a MergePatch update request body for.
 * @template NameTemplate A StringTemplate used to name any models created by applying
 * the merge-patch transform to the resource. The default name template is \`{name}MergePatchUpdate\`,
 * for example, the merge patch transform of model \`Widget\` is named \`WidgetMergePatchUpdate\`.
 *
 * @example
 * \`\`\`tsp
 * // An operation updating a 'Widget' using merge-patch
 * @patch op update(@body request: MergePatchUpdate<Widget>): Widget;
 * \`\`\`
 *
 * @example
 * \`\`\`tsp
 * // An operation updating a 'Widget' using merge-patch
 * @patch op update(@bodyRoot request: MergePatchUpdate<Widget>): Widget;
 * \`\`\`
 *
 * @example
 * \`\`\`tsp
 * // An operation updating a 'Widget' using merge-patch
 * @patch op update(...MergePatchUpdate<Widget>): Widget;
 * \`\`\`
 */
alias MergePatchUpdate<
  T extends Reflection.Model,
  NameTemplate extends valueof string = "{name}MergePatchUpdate"
> = applyMergePatchTransform(
  T,
  NameTemplate,
  #{ visibilityMode: Private.MergePatchVisibilityMode.Update }
);

/**
 * Create a MergePatch Request body for creating or updating the given resource Model.
 * The MergePatch request created by this template provides a TypeSpec description of a
 * JSON MergePatch request that can successfully create or update the given resource.
 * The transformation follows the definition of JSON MergePatch requests in
 * rfc 7396: https://www.rfc-editor.org/rfc/rfc7396,
 * applying the merge-patch transform recursively to keyed types in the resource Model.
 *
 * Using this template in a PATCH request body overrides the \`implicitOptionality\`
 * setting for PATCH operations and sets \`application/merge-patch+json\` as the request
 * content-type.
 *
 * @template T The type of the resource to create a MergePatch update request body for.
 * @template NameTemplate A StringTemplate used to name any models created by applying
 * the merge-patch transform to the resource. The default name template is \`{name}MergePatchCreateOrUpdate\`,
 * for example, the merge patch transform of model \`Widget\` is named \`WidgetMergePatchCreateOrUpdate\`.
 *
 * @example
 * \`\`\`tsp
 * // An operation updating a 'Widget' using merge-patch
 * @patch op update(@body request: MergePatchCreateOrUpdate<Widget>): Widget;
 * \`\`\`
 *
 * @example
 * \`\`\`tsp
 * // An operation updating a 'Widget' using merge-patch
 * @patch op update(@bodyRoot request: MergePatchCreateOrUpdate<Widget>): Widget;
 * \`\`\`
 *
 * @example
 * \`\`\`tsp
 * // An operation updating a 'Widget' using merge-patch
 * @patch op update(...MergePatchCreateOrUpdate<Widget>): Widget;
 * \`\`\`
 */
alias MergePatchCreateOrUpdate<
  T extends Reflection.Model,
  NameTemplate extends valueof string = "{name}MergePatchCreateOrUpdate"
> = applyMergePatchTransform(
  T,
  NameTemplate,
  #{ visibilityMode: Private.MergePatchVisibilityMode.CreateOrUpdate }
);
`,"../../../../../../src/typespec/core/packages/http/lib/decorators.tsp":`namespace TypeSpec.Http;

using TypeSpec.Reflection;

/**
 * Header options.
 */
model HeaderOptions {
  /**
   * Name of the header when sent over HTTP.
   */
  name?: string;

  /**
   * Equivalent of adding \`*\` in the path parameter as per [RFC-6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3)
   *
   *  | Style  | Explode | Primitive value = 5 | Array = [3, 4, 5] | Object = {"role": "admin", "firstName": "Alex"} |
   *  | ------ | ------- | ------------------- | ----------------- | ----------------------------------------------- |
   *  | simple | false   | \`5   \`              | \`3,4,5\`           | \`role,admin,firstName,Alex\`                     |
   *  | simple | true    | \`5\`                 | \`3,4,5\`           | \`role=admin,firstName=Alex\`                     |
   *
   */
  explode?: boolean;
}

/**
 * Specify this property is to be sent or received as an HTTP header.
 *
 * @param headerNameOrOptions Optional name of the header when sent over HTTP or header options.
 *  By default the header name will be the property name converted from camelCase to kebab-case. (e.g. \`contentType\` -> \`content-type\`)
 *
 * @example
 *
 * \`\`\`typespec
 * op read(@header accept: string): {@header("ETag") eTag: string};
 * op create(@header({name: "X-Color", format: "csv"}) colors: string[]): void;
 * \`\`\`
 *
 * @example Implicit header name
 *
 * \`\`\`typespec
 * op read(): {@header contentType: string}; // headerName: content-type
 * op update(@header ifMatch: string): void; // headerName: if-match
 * \`\`\`
 */
extern dec header(target: ModelProperty, headerNameOrOptions?: valueof string | HeaderOptions);

/**
 * Cookie Options.
 */
model CookieOptions {
  /**
   * Name in the cookie.
   */
  name?: string;
}

/**
 * Specify this property is to be sent or received in the cookie.
 *
 * @param cookieNameOrOptions Optional name of the cookie in the cookie or cookie options.
 *  By default the cookie name will be the property name converted from camelCase to snake_case. (e.g. \`authToken\` -> \`auth_token\`)
 *
 * @example
 *
 * \`\`\`typespec
 * op read(@cookie token: string): {data: string[]};
 * op create(@cookie({name: "auth_token"}) data: string[]): void;
 * \`\`\`
 *
 * @example Implicit header name
 *
 * \`\`\`typespec
 * op read(): {@cookie authToken: string}; // headerName: auth_token
 * op update(@cookie AuthToken: string): void; // headerName: auth_token
 * \`\`\`
 */
extern dec cookie(target: ModelProperty, cookieNameOrOptions?: valueof string | CookieOptions);

/**
 * Query parameter options.
 */
model QueryOptions {
  /**
   * Name of the query when included in the url.
   */
  name?: string;

  /**
   * If true send each value in the array/object as a separate query parameter.
   * Equivalent of adding \`*\` in the path parameter as per [RFC-6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3)
   *
   *  | Style  | Explode | Uri Template   | Primitive value id = 5 | Array id = [3, 4, 5]    | Object id = {"role": "admin", "firstName": "Alex"} |
   *  | ------ | ------- | -------------- | ---------------------- | ----------------------- | -------------------------------------------------- |
   *  | simple | false   | \`/users{?id}\`  | \`/users?id=5\`          | \`/users?id=3,4,5\`       | \`/users?id=role,admin,firstName,Alex\`              |
   *  | simple | true    | \`/users{?id*}\` | \`/users?id=5\`          | \`/users?id=3&id=4&id=5\` | \`/users?role=admin&firstName=Alex\`                 |
   *
   */
  explode?: boolean;
}

/**
 * Specify this property is to be sent as a query parameter.
 *
 * @param queryNameOrOptions Optional name of the query when included in the url or query parameter options.
 *
 * @example
 *
 * \`\`\`typespec
 * op read(@query select: string, @query("order-by") orderBy: string): void;
 * op list(@query(#{name: "id", explode: true}) ids: string[]): void;
 * \`\`\`
 */
extern dec query(target: ModelProperty, queryNameOrOptions?: valueof string | QueryOptions);

model PathOptions {
  /** Name of the parameter in the uri template. */
  name?: string;

  /**
   * When interpolating this parameter in the case of array or object expand each value using the given style.
   * Equivalent of adding \`*\` in the path parameter as per [RFC-6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3)
   */
  explode?: boolean;

  /**
   * Different interpolating styles for the path parameter.
   * - \`simple\`: No special encoding.
   * - \`label\`: Using \`.\` separator.
   * - \`matrix\`: \`;\` as separator.
   * - \`fragment\`: \`#\` as separator.
   * - \`path\`: \`/\` as separator.
   */
  style?: "simple" | "label" | "matrix" | "fragment" | "path";

  /**
   * When interpolating this parameter do not encode reserved characters.
   * Equivalent of adding \`+\` in the path parameter as per [RFC-6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3)
   */
  allowReserved?: boolean;
}

/**
 * Explicitly specify that this property is to be interpolated as a path parameter.
 *
 * @param paramNameOrOptions Optional name of the parameter in the uri template or options.
 *
 * @example
 *
 * \`\`\`typespec
 * @route("/read/{explicit}/things/{implicit}")
 * op read(@path explicit: string, implicit: string): void;
 * \`\`\`
 */
extern dec path(target: ModelProperty, paramNameOrOptions?: valueof string | PathOptions);

/**
 * Explicitly specify that this property type will be exactly the HTTP body.
 *
 * This means that any properties under \`@body\` cannot be marked as headers, query parameters, or path parameters.
 * If wanting to change the resolution of the body but still mix parameters, use \`@bodyRoot\`.
 *
 * @example
 *
 * \`\`\`typespec
 * op upload(@body image: bytes): void;
 * op download(): {@body image: bytes};
 * \`\`\`
 */
extern dec body(target: ModelProperty);

/**
 * Specify that the body resolution should be resolved from that property.
 * By default the body is resolved by including all properties in the operation request/response that are not metadata.
 * This allows to nest the body in a property while still allowing to use headers, query parameters, and path parameters in the same model.
 *
 * @example
 *
 * \`\`\`typespec
 * op upload(@bodyRoot user: {name: string, @header id: string}): void;
 * op download(): {@bodyRoot user: {name: string, @header id: string}};
 * \`\`\`
 */
extern dec bodyRoot(target: ModelProperty);
/**
 * Specify that this property shouldn't be included in the HTTP body.
 * This can be useful when bundling metadata together that would result in an empty property to be included in the body.
 *
 * @example
 *
 * \`\`\`typespec
 * op upload(name: string, @bodyIgnore headers: {@header id: string}): void;
 * \`\`\`
 */
extern dec bodyIgnore(target: ModelProperty);

/**
 * @example
 *
 * \`\`\`tsp
 * op upload(
 *   @header \`content-type\`: "multipart/form-data",
 *   @multipartBody body: {
 *     fullName: HttpPart<string>,
 *     headShots: HttpPart<Image>[]
 *   }
 * ): void;
 * \`\`\`
 */
extern dec multipartBody(target: ModelProperty);

/**
 * Specify the status code for this response. Property type must be a status code integer or a union of status code integer.
 *
 * @example
 *
 * \`\`\`typespec
 * op read(): {
 *   @statusCode _: 200;
 *   @body pet: Pet;
 * };
 * op create(): {
 *   @statusCode _: 201 | 202;
 * };
 * \`\`\`
 */
extern dec statusCode(target: ModelProperty);

/**
 * Specify the HTTP verb for the target operation to be \`GET\`.
 *
 * @example
 *
 * \`\`\`typespec
 * @get op read(): string
 * \`\`\`
 */
extern dec get(target: Operation);

/**
 * Specify the HTTP verb for the target operation to be \`PUT\`.
 *
 * @example
 *
 * \`\`\`typespec
 * @put op set(pet: Pet): void
 * \`\`\`
 */
extern dec put(target: Operation);

/**
 * Specify the HTTP verb for the target operation to be \`POST\`.
 *
 * @example
 *
 * \`\`\`typespec
 * @post op create(pet: Pet): void
 * \`\`\`
 */
extern dec post(target: Operation);

/**
 * Options for PATCH operations.
 */
model PatchOptions {
  /**
   * If set to \`false\`, disables the implicit transform that makes the body of a
   * PATCH operation deeply optional.
   *
   * @deprecated \`implicitOptionality\` is deprecated and will be removed.
   *   To preserve the previous behavior, define and use an explicit patch model
   *   with optional properties for your \`@body\` parameter.
   *   For actual JSON Merge Patch behavior, use \`MergePatchUpdate<T>\` as the
   *   \`@body\` type (for example: \`@patch op update(@body pet: MergePatchUpdate<Pet>): void;\`).
   */
  implicitOptionality?: boolean;
}

/**
 * Specify the HTTP verb for the target operation to be \`PATCH\`.
 *
 * @param options Options for the PATCH operation.
 *
 * @example
 *
 * \`\`\`typespec
 * @patch op update(pet: Pet): void;
 * \`\`\`
 *
 * @example Using MergePatch template for proper merge-patch semantics
 * \`\`\`typespec
 * @patch op update(@body pet: MergePatchUpdate<Pet>): void;
 * \`\`\`
 */
extern dec patch(target: Operation, options?: valueof PatchOptions);

/**
 * Specify the HTTP verb for the target operation to be \`DELETE\`.
 *
 * @example
 *
 * \`\`\`typespec
 * @delete op set(petId: string): void
 * \`\`\`
 */
extern dec delete(target: Operation);

/**
 * Specify the HTTP verb for the target operation to be \`HEAD\`.
 * @example
 *
 * \`\`\`typespec
 * @head op ping(petId: string): void
 * \`\`\`
 */
extern dec head(target: Operation);

/**
 * Specify an endpoint for this service. Multiple \`@server\` decorators can be used to specify multiple endpoints.
 *
 *  @param url Server endpoint
 *  @param description Description of the endpoint
 *  @param parameters Optional set of parameters used to interpolate the url.
 *
 * @example
 *
 * \`\`\`typespec
 * @service
 * @server("https://example.com")
 * namespace PetStore;
 * \`\`\`
 *
 * @example With a description
 *
 * \`\`\`typespec
 * @service
 * @server("https://example.com", "Single server endpoint")
 * namespace PetStore;
 * \`\`\`
 *
 * @example Parameterized
 *
 * \`\`\`typespec
 * @server("https://{region}.foo.com", "Regional endpoint", {
 *   @doc("Region name")
 *   region?: string = "westus",
 * })
 * \`\`\`
 *
 * @example Multiple
 * \`\`\`typespec
 * @service
 * @server("https://example.com", "Standard endpoint")
 * @server("https://{project}.private.example.com", "Private project endpoint", {
 *   project: string;
 * })
 * namespace PetStore;
 * \`\`\`
 *
 */
extern dec server(
  target: Namespace,
  url: valueof string,
  description?: valueof string,
  parameters?: Record<unknown>
);

/**
 * Specify authentication for a whole service or specific methods. See the [documentation in the Http library](https://typespec.io/docs/libraries/http/authentication) for full details.
 *
 * @param auth Authentication configuration. Can be a single security scheme, a union(either option is valid authentication) or a tuple (must use all authentication together)
 * @example
 *
 * \`\`\`typespec
 * @service
 * @useAuth(BasicAuth)
 * namespace PetStore;
 * \`\`\`
 */
extern dec useAuth(target: Namespace | Interface | Operation, auth: {} | Union | {}[]);

/**
 * Defines the relative route URI template for the target operation as defined by [RFC 6570](https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.3)
 *
 * \`@route\` can only be applied to operations, namespaces, and interfaces.
 *
 * @param uriTemplate Uri template for this operation.
 *
 * @example Simple path parameter
 *
 * \`\`\`typespec
 * @route("/widgets/{id}") op getWidget(@path id: string): Widget;
 * \`\`\`
 *
 * @example Reserved characters
 * \`\`\`typespec
 * @route("/files{+path}") op getFile(@path path: string): bytes;
 * \`\`\`
 *
 * @example Query parameter
 * \`\`\`typespec
 * @route("/files") op list(select?: string, filter?: string): Files[];
 * @route("/files{?select,filter}") op listFullUriTemplate(select?: string, filter?: string): Files[];
 * \`\`\`
 */
extern dec route(target: Namespace | Interface | Operation, path: valueof string);

/**
 * \`@sharedRoute\` marks the operation as sharing a route path with other operations.
 *
 * When an operation is marked with \`@sharedRoute\`, it enables other operations to share the same
 * route path as long as those operations are also marked with \`@sharedRoute\`.
 *
 * \`@sharedRoute\` can only be applied directly to operations.
 *
 * \`\`\`typespec
 * @sharedRoute
 * @route("/widgets")
 * op getWidget(@path id: string): Widget;
 * \`\`\`
 */
extern dec sharedRoute(target: Operation);
`,"../../../../../../src/typespec/core/packages/http/lib/private.decorators.tsp":`/**
 * Private decorators. Those are meant for internal use inside Http types only.
 */
namespace TypeSpec.Http.Private;

extern dec plainData(target: TypeSpec.Reflection.Model);
extern dec httpFile(target: TypeSpec.Reflection.Model);
extern dec httpPart(
  target: TypeSpec.Reflection.Model,
  type: unknown,
  options: valueof HttpPartOptions
);

/**
 * Specify if inapplicable metadata should be included in the payload for the given entity.
 * @param value If true, inapplicable metadata will be included in the payload.
 */
extern dec includeInapplicableMetadataInPayload(target: unknown, value: valueof boolean);

/**
 * The visibility mode for the merge patch transform.
 */
enum MergePatchVisibilityMode {
  /**
   * The Update mode. This is used when a resource can be updated but must already exist.
   */
  Update,

  /**
   * The Create or Update mode. This is used when a resource can be created OR updated in a single operation.
   */
  CreateOrUpdate,
}

/**
 * Options for the \`@applyMergePatch\` decorator.
 */
model ApplyMergePatchOptions {
  /**
   * The visibility mode to use.
   */
  visibilityMode: MergePatchVisibilityMode;
}

/**
 * Performs the canonical merge-patch transformation on the given model and injects its
 * transformed properties into the target.
 */
#deprecated "applyMergePatch is deprecated and will be removed in a future release. This decorator is not intended for public use."
extern dec applyMergePatch(
  target: Reflection.Model,
  source: Reflection.Model,
  nameTemplate: valueof string,
  options: valueof ApplyMergePatchOptions
);

#suppress "experimental-feature"
internal extern fn applyMergePatchTransform(
  input: Reflection.Model,
  nameTemplate: valueof string,
  options: valueof ApplyMergePatchOptions
): Reflection.Model;

/**
 * Marks a model that was generated by applying the MergePatch
 * transform and links to its source model
 */
extern dec mergePatchModel(target: Reflection.Model, source: Reflection.Model);

/**
 * Links a modelProperty mutated as part of a mergePatch transform to
 * its source property;
 */
extern dec mergePatchProperty(target: Reflection.ModelProperty, source: Reflection.ModelProperty);
`,"../../../../../../src/typespec/core/packages/http/lib/auth.tsp":`namespace TypeSpec.Http;

@doc("Authentication type")
enum AuthType {
  @doc("HTTP")
  http,

  @doc("API key")
  apiKey,

  @doc("OAuth2")
  oauth2,

  @doc("OpenID connect")
  openIdConnect,

  @doc("Empty auth")
  noAuth,
}

/**
 * Basic authentication is a simple authentication scheme built into the HTTP protocol.
 * The client sends HTTP requests with the Authorization header that contains the word Basic word followed by a space and a base64-encoded string username:password.
 * For example, to authorize as demo / \`p@55w0rd\` the client would send
 * \`\`\`
 * Authorization: Basic ZGVtbzpwQDU1dzByZA==
 * \`\`\`
 */
@doc("")
model BasicAuth {
  @doc("Http authentication")
  type: AuthType.http;

  @doc("basic auth scheme")
  scheme: "Basic";
}

/**
 * Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens.
 * The name \u201CBearer authentication\u201D can be understood as \u201Cgive access to the bearer of this token.\u201D The bearer token is a cryptic string, usually generated by the server in response to a login request.
 * The client must send this token in the Authorization header when making requests to protected resources:
 * \`\`\`
 * Authorization: Bearer <token>
 * \`\`\`
 */
@doc("")
model BearerAuth {
  @doc("Http authentication")
  type: AuthType.http;

  @doc("bearer auth scheme")
  scheme: "Bearer";
}

@doc("Describes the location of the API key")
enum ApiKeyLocation {
  @doc("API key is a header value")
  header,

  @doc("API key is a query parameter")
  query,

  @doc("API key is found in a cookie")
  cookie,
}

/**
 * An API key is a token that a client provides when making API calls. The key can be sent in the query string:
 *
 * \`\`\`
 * GET /something?api_key=abcdef12345
 * \`\`\`
 *
 * or as a request header
 *
 * \`\`\`
 * GET /something HTTP/1.1
 * X-API-Key: abcdef12345
 * \`\`\`
 *
 * or as a cookie
 *
 * \`\`\`
 * GET /something HTTP/1.1
 * Cookie: X-API-KEY=abcdef12345
 * \`\`\`
 *
 * @template Location The location of the API key
 * @template Name The name of the API key
 */
@doc("")
model ApiKeyAuth<Location extends ApiKeyLocation, Name extends string> {
  @doc("API key authentication")
  type: AuthType.apiKey;

  @doc("location of the API key")
  in: Location;

  @doc("name of the API key")
  name: Name;
}

/**
 * OAuth 2.0 is an authorization protocol that gives an API client limited access to user data on a web server.
 *
 * OAuth relies on authentication scenarios called flows, which allow the resource owner (user) to share the protected content from the resource server without sharing their credentials.
 * For that purpose, an OAuth 2.0 server issues access tokens that the client applications can use to access protected resources on behalf of the resource owner.
 * For more information about OAuth 2.0, see oauth.net and RFC 6749.
 *
 * @template Flows The list of supported OAuth2 flows
 * @template Scopes The list of OAuth2 scopes, which are common for every flow from \`Flows\`. This list is combined with the scopes defined in specific OAuth2 flows.
 */
@doc("")
model OAuth2Auth<Flows extends OAuth2Flow[], Scopes extends string[] = []> {
  @doc("OAuth2 authentication")
  type: AuthType.oauth2;

  @doc("Supported OAuth2 flows")
  flows: Flows;

  @doc("Oauth2 scopes of every flow. Overridden by scope definitions in specific flows")
  defaultScopes: Scopes;
}

@doc("Describes the OAuth2 flow type")
enum OAuth2FlowType {
  @doc("authorization code flow")
  authorizationCode,

  @doc("implicit flow")
  implicit,

  @doc("password flow")
  password,

  @doc("client credential flow")
  clientCredentials,
}

alias OAuth2Flow = AuthorizationCodeFlow | ImplicitFlow | PasswordFlow | ClientCredentialsFlow;

@doc("Authorization Code flow")
model AuthorizationCodeFlow {
  @doc("authorization code flow")
  type: OAuth2FlowType.authorizationCode;

  @doc("the authorization URL")
  authorizationUrl: string;

  @doc("the token URL")
  tokenUrl: string;

  @doc("the refresh URL")
  refreshUrl?: string;

  @doc("list of scopes for the credential")
  scopes?: string[];
}

@doc("Implicit flow")
model ImplicitFlow {
  @doc("implicit flow")
  type: OAuth2FlowType.implicit;

  @doc("the authorization URL")
  authorizationUrl: string;

  @doc("the refresh URL")
  refreshUrl?: string;

  @doc("list of scopes for the credential")
  scopes?: string[];
}

@doc("Resource Owner Password flow")
model PasswordFlow {
  @doc("password flow")
  type: OAuth2FlowType.password;

  @doc("the token URL")
  tokenUrl: string;

  @doc("the refresh URL")
  refreshUrl?: string;

  @doc("list of scopes for the credential")
  scopes?: string[];
}

@doc("Client credentials flow")
model ClientCredentialsFlow {
  @doc("client credential flow")
  type: OAuth2FlowType.clientCredentials;

  @doc("the token URL")
  tokenUrl: string;

  @doc("the refresh URL")
  refreshUrl?: string;

  @doc("list of scopes for the credential")
  scopes?: string[];
}

/**
 * OpenID Connect (OIDC) is an identity layer built on top of the OAuth 2.0 protocol and supported by some OAuth 2.0 providers, such as Google and Azure Active Directory.
 * It defines a sign-in flow that enables a client application to authenticate a user, and to obtain information (or "claims") about that user, such as the user name, email, and so on.
 * User identity information is encoded in a secure JSON Web Token (JWT), called ID token.
 * OpenID Connect defines a discovery mechanism, called OpenID Connect Discovery, where an OpenID server publishes its metadata at a well-known URL, typically
 *
 * \`\`\`http
 * https://server.com/.well-known/openid-configuration
 * \`\`\`
 */
model OpenIdConnectAuth<ConnectUrl extends string> {
  /** Auth type */
  type: AuthType.openIdConnect;

  /** Connect url. It can be specified relative to the server URL */
  openIdConnectUrl: ConnectUrl;
}

/**
 * This authentication option signifies that API is not secured at all.
 * It might be useful when overriding authentication on interface of operation level.
 */
@doc("")
model NoAuth {
  type: AuthType.noAuth;
}
`,"../../../../../../src/typespec/core/packages/rest/lib/rest.tsp":`import "@typespec/http";
import "./rest-decorators.tsp";
import "./resource.tsp";
import "../dist/src/tsp-index.js";

namespace TypeSpec.Rest;

/**
 * A URL that points to a resource.
 * @template Resource The type of resource that the URL points to.
 */
@doc("The location of an instance of {name}", Resource)
@Private.resourceLocation(Resource)
scalar ResourceLocation<Resource extends {}> extends url;
`,"../../../../../../src/typespec/core/packages/rest/lib/rest-decorators.tsp":`namespace TypeSpec.Rest;

using TypeSpec.Reflection;

/**
 * This interface or operation should resolve its route automatically. To be used with resource types where the route segments area defined on the models.
 *
 * @example
 *
 * \`\`\`typespec
 * @autoRoute
 * interface Pets {
 *   get(@segment("pets") @path id: string): void; //-> route: /pets/{id}
 * }
 * \`\`\`
 */
extern dec autoRoute(target: Interface | Operation);

/**
 * Defines the preceding path segment for a @path parameter in auto-generated routes.
 *
 * @param name Segment that will be inserted into the operation route before the path parameter's name field.
 *
 * @example
 * @autoRoute
 * interface Pets {
 *   get(@segment("pets") @path id: string): void; //-> route: /pets/{id}
 * }
 */
extern dec segment(target: Model | ModelProperty | Operation, name: valueof string);

/**
 * Returns the URL segment of a given model if it has \`@segment\` and \`@key\` decorator.
 * @param type Target model
 */
extern dec segmentOf(target: Operation, type: Model);

/**
 * Defines the separator string that is inserted before the action name in auto-generated routes for actions.
 *
 * When applied to a namespace, the separator applies to all action operations in that namespace and its sub-namespaces.
 * When applied to an interface, the separator applies to all action operations in that interface and overrides any namespace-level separator.
 * When applied to an operation, the separator applies only to that operation and overrides any interface or namespace-level separator.
 *
 * @param seperator Seperator seperating the action segment from the rest of the url
 */
extern dec actionSeparator(
  target: Operation | Interface | Namespace,
  seperator: valueof "/" | ":" | "/:"
);

/**
 * Mark this model as a resource type with a name.
 *
 * @param collectionName type's collection name
 */
extern dec resource(target: Model, collectionName: valueof string);

/**
 * Mark model as a child of the given parent resource.
 * @param parent Parent model.
 */
extern dec parentResource(target: Model, parent: Model);

/**
 * Specify that this is a Read operation for a given resource.
 *
 * @param resourceType Resource marked with @resource
 */
extern dec readsResource(target: Operation, resourceType: Model);

/**
 * Specify that this is a Create operation for a given resource.
 *
 * @param resourceType Resource marked with @resource
 */
extern dec createsResource(target: Operation, resourceType: Model);

/**
 * Specify that this is a CreateOrReplace operation for a given resource.
 *
 * @param resourceType Resource marked with @resource
 */
extern dec createsOrReplacesResource(target: Operation, resourceType: Model);

/**
 * Specify that this is a CreatesOrUpdate operation for a given resource.
 *
 * @param resourceType Resource marked with @resource
 */
extern dec createsOrUpdatesResource(target: Operation, resourceType: Model);

/**
 * Specify that this is a Update operation for a given resource.
 *
 * @param resourceType Resource marked with @resource
 */
extern dec updatesResource(target: Operation, resourceType: Model);

/**
 * Specify that this is a Delete operation for a given resource.
 *
 * @param resourceType Resource marked with @resource
 */
extern dec deletesResource(target: Operation, resourceType: Model);

/**
 * Specify that this is a List operation for a given resource.
 *
 * @param resourceType Resource marked with @resource
 */
extern dec listsResource(target: Operation, resourceType: Model);

/**
 * Specify this operation is an action. (Scoped to a resource item /pets/{petId}/my-action)
 * @param name Name of the action. If not specified, the name of the operation will be used.
 */
extern dec action(target: Operation, name?: valueof string);

/**
 * Specify this operation is a collection action. (Scopped to a resource, /pets/my-action)
 * @param resourceType Resource marked with @resource
 * @param name Name of the action. If not specified, the name of the operation will be used.
 */
extern dec collectionAction(target: Operation, resourceType: Model, name?: valueof string);

/**
 * Copy the resource key parameters on the model
 * @param filter Filter to exclude certain properties.
 */
extern dec copyResourceKeyParameters(target: Model, filter?: valueof string);

namespace Private {
  extern dec resourceLocation(target: string, resourceType: Model);
  extern dec validateHasKey(target: unknown, value: unknown);
  extern dec validateIsError(target: unknown, value: unknown);
  extern dec actionSegment(target: Operation, value: valueof string);
  extern dec resourceTypeForKeyParam(entity: ModelProperty, resourceType: Model);
}
`,"../../../../../../src/typespec/core/packages/rest/lib/resource.tsp":`import "@typespec/http";
import "../dist/src/internal-decorators.js";

namespace TypeSpec.Rest.Resource;

using Http;

@doc("The default error response for resource operations.")
model ResourceError {
  @doc("The error code.")
  code: int32;

  @doc("The error message.")
  message: string;
}

/**
 * Dynamically gathers keys of the model type \`Resource\`.
 *
 * @template Resource The target resource model.
 */
@doc("Dynamically gathers keys of the model type Resource.")
@copyResourceKeyParameters
@friendlyName("{name}Key", Resource)
model KeysOf<Resource> {}

/**
 * Dynamically gathers parent keys of the model type \`Resource\`.
 *
 * @template Resource The target resource model.
 */
@doc("Dynamically gathers parent keys of the model type Resource.")
@copyResourceKeyParameters("parent")
@friendlyName("{name}ParentKey", Resource)
model ParentKeysOf<Resource> {}

/**
 * Represents operation parameters for the resource of type \`Resource\`.
 *
 * @template Resource The resource model.
 */
@doc("Represents operation parameters for resource Resource.")
model ResourceParameters<Resource extends {}> {
  ...KeysOf<Resource>;
}

/**
 * Represents collection operation parameters for the resource of type \`Resource\`.
 *
 * @template Resource The resource model.
 */
@doc("Represents collection operation parameters for resource Resource.")
model ResourceCollectionParameters<Resource extends {}> {
  ...ParentKeysOf<Resource>;
}

/**
 * Represents the resource GET operation.
 *
 * @template Resource The resource model.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface ResourceRead<Resource extends {}, Error> {
  /**
   * Gets an instance of the resource.
   *
   * @template Resource The resource model.
   */
  @autoRoute
  @doc("Gets an instance of the resource.")
  @readsResource(Resource)
  get(...ResourceParameters<Resource>): Resource | Error;
}

/**
 * Resource create operation completed successfully.
 *
 * @template Resource The resource model that was created.
 */
@doc("Resource create operation completed successfully.")
model ResourceCreatedResponse<Resource> {
  ...CreatedResponse;
  @bodyRoot body: Resource;
}

/**
 * Resource create or replace operation template.
 *
 * @template Resource The resource model to create or replace.
 * @template Error The error response.
 */
interface ResourceCreateOrReplace<Resource extends {}, Error> {
  /**
   * Creates or replaces a instance of the resource.
   *
   * @template Resource The resource model to create or replace.
   * @template Error The error response.
   */
  @autoRoute
  @doc("Creates or replaces an instance of the resource.")
  @createsOrReplacesResource(Resource)
  createOrReplace(
    ...ResourceParameters<Resource>,
    @bodyRoot resource: ResourceCreateModel<Resource>,
  ): Resource | ResourceCreatedResponse<Resource> | Error;
}

/**
 * Resource create or update operation model.
 *
 * @template Resource The resource model to create or update.
 */
@friendlyName("{name}Update", Resource)
model ResourceCreateOrUpdateModel<Resource extends {}>
  is OptionalProperties<UpdateableProperties<DefaultKeyVisibility<Resource, Lifecycle.Read>>>;

/**
 * Resource create or update operation template.
 *
 * @template Resource The resource model to create or update.
 * @template Error The error response.
 */
interface ResourceCreateOrUpdate<Resource extends {}, Error> {
  /**
   * Creates or update an instance of the resource.
   *
   * @template Resource The resource model to create or update.
   * @template Error The error response.
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "for legacy behavior"
  @autoRoute
  @doc("Creates or update an instance of the resource.")
  @createsOrUpdatesResource(Resource)
  @patch(#{ implicitOptionality: true }) // for legacy behavior
  createOrUpdate(
    ...ResourceParameters<Resource>,
    @bodyRoot resource: ResourceCreateOrUpdateModel<Resource>,
  ): Resource | ResourceCreatedResponse<Resource> | Error;
}

/**
 * Resource create operation model.
 *
 * @template Resource The resource model to create.
 */
@friendlyName("{name}Create", Resource)
@withVisibility(Lifecycle.Create)
model ResourceCreateModel<Resource extends {}> is DefaultKeyVisibility<Resource, Lifecycle.Read>;

/**
 * Resource create operation template.
 *
 * @template Resource The resource model to create.
 * @template Error The error response.
 */
interface ResourceCreate<Resource extends {}, Error> {
  /**
   * Creates a new instance of the resource.
   *
   * @template Resource The resource model to create.
   * @template Error The error response.
   */
  @autoRoute
  @doc("Creates a new instance of the resource.")
  @createsResource(Resource)
  create(
    ...ResourceCollectionParameters<Resource>,
    @bodyRoot resource: ResourceCreateModel<Resource>,
  ): Resource | ResourceCreatedResponse<Resource> | Error;
}

/**
 * Resource update operation template.
 *
 * @template Resource The resource model to update.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface ResourceUpdate<Resource extends {}, Error> {
  /**
   * Updates an existing instance of the resource.
   *
   * @template Resource The resource model to update.
   * @template Error The error response.
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "for legacy behavior"
  @autoRoute
  @doc("Updates an existing instance of the resource.")
  @updatesResource(Resource)
  @patch(#{ implicitOptionality: true }) // for legacy behavior
  update(
    ...ResourceParameters<Resource>,
    @bodyRoot properties: ResourceCreateOrUpdateModel<Resource>,
  ): Resource | Error;
}

@doc("Resource deleted successfully.")
model ResourceDeletedResponse {
  @doc("The status code.")
  @statusCode
  _: 200;
}

/**
 * Resource delete operation template.
 *
 * @template Resource The resource model to delete.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface ResourceDelete<Resource extends {}, Error> {
  /**
   * Deletes an existing instance of the resource.
   *
   * @template Resource The resource model to delete.
   * @template Error The error response.
   */
  @autoRoute
  @doc("Deletes an existing instance of the resource.")
  @deletesResource(Resource)
  delete(...ResourceParameters<Resource>): ResourceDeletedResponse | Error;
}

/**
 * Structure for a paging response using \`value\` and \`nextLink\` to represent pagination.
 *
 * @template Resource The resource type of the collection.
 */
@doc("Paged response of {name} items", Resource)
@friendlyName("{name}CollectionWithNextLink", Resource)
model CollectionWithNextLink<Resource extends {}> {
  @doc("The items on this page")
  @pageItems
  value: Resource[];

  @doc("The link to the next page of items")
  @nextLink
  nextLink?: ResourceLocation<Resource>;
}

/**
 * Resource list operation template.
 *
 * @template Resource The resource model to list.
 * @template Error The error response.
 */
interface ResourceList<Resource extends {}, Error> {
  /**
   * Lists all instances of the resource.
   *
   * @template Resource The resource model to list.
   * @template Error The error response.
   */
  @autoRoute
  @doc("Lists all instances of the resource.")
  @listsResource(Resource)
  list(...ResourceCollectionParameters<Resource>): CollectionWithNextLink<Resource> | Error;
}

/**
 * Resource operation templates for resource instances.
 *
 * @template Resource The resource model.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface ResourceInstanceOperations<Resource extends {}, Error>
  extends ResourceRead<Resource, Error>,
    ResourceUpdate<Resource, Error>,
    ResourceDelete<Resource, Error> {}

/**
 * Resource operation templates for resource collections.
 *
 * @template Resource The resource model.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface ResourceCollectionOperations<Resource extends {}, Error>
  extends ResourceCreate<Resource, Error>,
    ResourceList<Resource, Error> {}

/**
 * Resource operation templates for resources.
 *
 * @template Resource The resource model.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface ResourceOperations<Resource extends {}, Error>
  extends ResourceInstanceOperations<Resource, Error>,
    ResourceCollectionOperations<Resource, Error> {}

/**
 * Singleton resource read operation template.
 *
 * @template Singleton The singleton resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface SingletonResourceRead<Singleton extends {}, Resource extends {}, Error> {
  /**
   * Gets the singleton resource.
   *
   * @template Singleton The singleton resource model.
   * @template Resource The resource model.
   */
  @autoRoute
  @doc("Gets the singleton resource.")
  @segmentOf(Singleton)
  @readsResource(Singleton)
  get(...ResourceParameters<Resource>): Singleton | Error;
}

/**
 * Singleton resource update operation template.
 *
 * @template Singleton The singleton resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface SingletonResourceUpdate<Singleton extends {}, Resource extends {}, Error> {
  /**
   * Updates the singleton resource.
   *
   * @template Singleton The singleton resource model.
   * @template Resource The resource model.
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "for legacy behavior"
  @autoRoute
  @doc("Updates the singleton resource.")
  @segmentOf(Singleton)
  @updatesResource(Singleton)
  @patch(#{ implicitOptionality: true }) // for legacy behavior
  update(
    ...ResourceParameters<Resource>,

    @body
    properties: ResourceCreateOrUpdateModel<Singleton>,
  ): Singleton | Error;
}

/**
 * Singleton resource operation templates for singleton resource instances.
 *
 * @template Singleton The singleton resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface SingletonResourceOperations<Singleton extends {}, Resource extends {}, Error>
  extends SingletonResourceRead<Singleton, Resource, Error>,
    SingletonResourceUpdate<Singleton, Resource, Error> {}

/**
 * Extension resource read operation template.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
@Private.validateHasKey(Resource)
@Private.validateIsError(Error)
interface ExtensionResourceRead<Extension extends {}, Resource extends {}, Error> {
  /**
   * Gets an instance of the extension resource.
   *
   * @template Extension The extension resource model.
   * @template Resource The resource model.
   */
  @autoRoute
  @doc("Gets an instance of the extension resource.")
  @readsResource(Extension)
  get(...ResourceParameters<Resource>, ...ResourceParameters<Extension>): Extension | Error;
}

/**
 * Extension resource create or update operation template.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface ExtensionResourceCreateOrUpdate<Extension extends {}, Resource extends {}, Error> {
  /**
   * Creates or update an instance of the extension resource.
   *
   * @template Extension The extension resource model.
   * @template Resource The resource model.
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "for legacy behavior"
  @autoRoute
  @doc("Creates or update an instance of the extension resource.")
  @createsOrUpdatesResource(Extension)
  @patch(#{ implicitOptionality: true }) // for legacy behavior
  createOrUpdate(
    ...ResourceParameters<Resource>,
    ...ResourceParameters<Extension>,
    @bodyRoot resource: ResourceCreateOrUpdateModel<Extension>,
  ): Extension | ResourceCreatedResponse<Extension> | Error;
}

/**
 * Extension resource create operation template.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface ExtensionResourceCreate<Extension extends {}, Resource extends {}, Error> {
  /**
   * Creates a new instance of the extension resource.
   *
   * @template Extension The extension resource model.
   * @template Resource The resource model.
   */
  @autoRoute
  @doc("Creates a new instance of the extension resource.")
  @createsResource(Extension)
  create(...ResourceParameters<Resource>, @bodyRoot resource: ResourceCreateModel<Extension>):
    | Extension
    | ResourceCreatedResponse<Extension>
    | Error;
}

/**
 * Extension resource update operation template.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface ExtensionResourceUpdate<Extension extends {}, Resource extends {}, Error> {
  /**
   * Updates an existing instance of the extension resource.
   *
   * @template Extension The extension resource model.
   * @template Resource The resource model.
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "for legacy behavior"
  @autoRoute
  @doc("Updates an existing instance of the extension resource.")
  @updatesResource(Extension)
  @patch(#{ implicitOptionality: true }) // for legacy behavior
  update(
    ...ResourceParameters<Resource>,
    ...ResourceParameters<Extension>,

    @body
    properties: ResourceCreateOrUpdateModel<Extension>,
  ): Extension | Error;
}

/**
 * Extension resource delete operation template.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface ExtensionResourceDelete<Extension extends {}, Resource extends {}, Error> {
  /**
   * Deletes an existing instance of the extension resource.
   *
   * @template Extension The extension resource model.
   * @template Resource The resource model.
   */
  @autoRoute
  @doc("Deletes an existing instance of the extension resource.")
  @deletesResource(Extension)
  delete(...ResourceParameters<Resource>, ...ResourceParameters<Extension>):
    | ResourceDeletedResponse
    | Error;
}

/**
 * Extension resource list operation template.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface ExtensionResourceList<Extension extends {}, Resource extends {}, Error> {
  /**
   * Lists all instances of the extension resource.
   *
   * @template Extension The extension resource model.
   * @template Resource The resource model.
   */
  @autoRoute
  @doc("Lists all instances of the extension resource.")
  @listsResource(Extension)
  list(...ResourceParameters<Resource>, ...ResourceCollectionParameters<Extension>):
    | CollectionWithNextLink<Extension>
    | Error;
}

/**
 * Extension resource operation templates for extension resource instances.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface ExtensionResourceInstanceOperations<Extension extends {}, Resource extends {}, Error>
  extends ExtensionResourceRead<Extension, Resource, Error>,
    ExtensionResourceUpdate<Extension, Resource, Error>,
    ExtensionResourceDelete<Extension, Resource, Error> {}

/**
 * Extension resource operation templates for extension resource collections.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface ExtensionResourceCollectionOperations<Extension extends {}, Resource extends {}, Error>
  extends ExtensionResourceCreate<Extension, Resource, Error>,
    ExtensionResourceList<Extension, Resource, Error> {}

/**
 * Extension resource operation templates for extension resource instances and collections.
 *
 * @template Extension The extension resource model.
 * @template Resource The resource model.
 * @template Error The error response.
 */
interface ExtensionResourceOperations<Extension extends {}, Resource extends {}, Error>
  extends ExtensionResourceInstanceOperations<Extension, Resource, Error>,
    ExtensionResourceCollectionOperations<Extension, Resource, Error> {}
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/auth.tsp":`import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "./traits.tsp";

using Http;
using Rest;
using Versioning;
using Azure.Core.Traits;
using Azure.Core.Traits.Private;

namespace Azure.Core;

/**
 * Azure Active Directory (AAD) Token Authentication Flow
 * @template AuthUrl The authorization URL.
 * @template TokenUrl The token URL.
 * @template Scopes A list of scopes the token applies to.
 */
model AadTokenAuthFlow<Scopes extends string[], AuthUrl extends string, TokenUrl extends string>
  extends TypeSpec.Http.AuthorizationCodeFlow {
  type: OAuth2FlowType.authorizationCode;
  authorizationUrl: AuthUrl;
  tokenUrl: TokenUrl;
  scopes: Scopes;
}

/**
 * Azure Active Directory OAuth2 Flow
 * @template AuthUrl The authorization URL.
 * @template TokenUrl The token URL.
 * @template Scopes A list of scopes the token applies to.
 */
@doc("The Azure Active Directory OAuth2 Flow")
model AadOauth2Auth<
  Scopes extends string[],
  AuthUrl extends string = "https://login.microsoftonline.com/common/oauth2/authorize",
  TokenUrl extends string = "https://login.microsoftonline.com/common/oauth2/token"
> is OAuth2Auth<[AadTokenAuthFlow<Scopes, AuthUrl, TokenUrl>]>;

/**
 * Azure API Key Authentication using the "Ocp-Apim-Subscription-Key" hea
 */
@doc("Azure API Key Authentication")
model AzureApiKeyAuthentication
  is TypeSpec.Http.ApiKeyAuth<ApiKeyLocation.header, "Ocp-Apim-Subscription-Key">;
`,"../../../../../../src/typespec/core/packages/versioning/lib/main.tsp":`import "./decorators.tsp";
import "../dist/src/validate.js";
`,"../../../../../../src/typespec/core/packages/versioning/lib/decorators.tsp":`import "../dist/src/decorators.js";

using TypeSpec.Reflection;

namespace TypeSpec.Versioning;

/**
 * Identifies that the decorated namespace is versioned by the provided enum.
 * @param versions The enum that describes the supported versions.
 *
 * @example
 *
 * \`\`\`tsp
 * @versioned(Versions)
 * namespace MyService;
 * enum Versions {
 *   v1,
 *   v2,
 *   v3,
 * }
 * \`\`\`
 */
extern dec versioned(target: Namespace, versions: Enum);

/**
 * Identifies that a namespace or a given versioning enum member relies upon a versioned package.
 * @param versionRecords The dependent library version(s) for the target namespace or version.
 *
 * @example Select a single version of \`MyLib\` to use
 *
 * \`\`\`tsp
 * @useDependency(MyLib.Versions.v1_1)
 * namespace NonVersionedService;
 * \`\`\`
 *
 * @example Select which version of the library match to which version of the service.
 *
 * \`\`\`tsp
 * @versioned(Versions)
 * namespace MyService1;
 * enum Version {
 *   @useDependency(MyLib.Versions.v1_1) // V1 use lib v1_1
 *   v1,
 *   @useDependency(MyLib.Versions.v1_1) // V2 use lib v1_1
 *   v2,
 *   @useDependency(MyLib.Versions.v2) // V3 use lib v2
 *   v3,
 * }
 * \`\`\`
 */
extern dec useDependency(target: EnumMember | Namespace, ...versionRecords: EnumMember[]);

/**
 * Identifies when the target was added.
 * @param version The version that the target was added in.
 *
 * @example
 *
 * \`\`\`tsp
 * @added(Versions.v2)
 * op addedInV2(): void;
 *
 * @added(Versions.v2)
 * model AlsoAddedInV2 {}
 *
 * model Foo {
 *   name: string;
 *
 *   @added(Versions.v3)
 *   addedInV3: string;
 * }
 * \`\`\`
 */
extern dec added(
  target:
    | Model
    | ModelProperty
    | Operation
    | Enum
    | EnumMember
    | Union
    | UnionVariant
    | Scalar
    | Interface,
  version: EnumMember
);

/**
 * Identifies when the target was removed.
 * @param version The version that the target was removed in.
 *
 * @example
 * \`\`\`tsp
 * @removed(Versions.v2)
 * op removedInV2(): void;
 *
 * @removed(Versions.v2)
 * model AlsoRemovedInV2 {}
 *
 * model Foo {
 *   name: string;
 *
 *   @removed(Versions.v3)
 *   removedInV3: string;
 * }
 * \`\`\`
 */
extern dec removed(
  target:
    | Model
    | ModelProperty
    | Operation
    | Enum
    | EnumMember
    | Union
    | UnionVariant
    | Scalar
    | Interface,
  version: EnumMember
);

/**
 * Identifies when the target has been renamed.
 * @param version The version that the target was renamed in.
 * @param oldName The previous name of the target.
 *
 * @example
 * \`\`\`tsp
 * @renamedFrom(Versions.v2, "oldName")
 * op newName(): void;
 * \`\`\`
 */
extern dec renamedFrom(
  target:
    | Model
    | ModelProperty
    | Operation
    | Enum
    | EnumMember
    | Union
    | UnionVariant
    | Scalar
    | Interface,
  version: EnumMember,
  oldName: valueof string
);

/**
 * Identifies when a target was made optional.
 * @param version The version that the target was made optional in.
 *
 * @example
 *
 * \`\`\`tsp
 * model Foo {
 *   name: string;
 *   @madeOptional(Versions.v2)
 *   nickname?: string;
 * }
 * \`\`\`
 */
extern dec madeOptional(target: ModelProperty, version: EnumMember);

/**
 * Identifies when a target was made required.
 * @param version The version that the target was made required in.
 *
 * @example
 *
 * \`\`\`tsp
 * model Foo {
 *   name: string;
 *   @madeRequired(Versions.v2)
 *   nickname: string;
 * }
 * \`\`\`
 */
extern dec madeRequired(target: ModelProperty, version: EnumMember);

/**
 * Declares that the type of a model property has changed starting at a given version,
 * while keeping earlier versions consistent with the previous type.
 *
 * This decorator is used to track type changes across API versions. When applied,
 * the property will use \`oldType\` in versions before the specified \`version\`,
 * and the current type definition in the specified version and later.
 *
 * @param version The version when the type change takes effect. The new type applies
 *                from this version onwards, while the old type applies to earlier versions.
 * @param oldType The previous type used before the specified version.
 *
 * @example
 *
 * \`\`\`tsp
 * model Foo {
 *   // In v1: id is a string
 *   // In v2+: id is an int32
 *   @typeChangedFrom(Versions.v2, string)
 *   id: int32;
 * }
 * \`\`\`
 */
extern dec typeChangedFrom(target: ModelProperty, version: EnumMember, oldType: unknown);

/**
 * Declares that the return type of an operation has changed starting at a given version,
 * while keeping earlier versions consistent with the previous return type.
 *
 * This decorator is used to track return type changes across API versions. When applied,
 * the operation will return \`oldType\` in versions before the specified \`version\`,
 * and the current return type definition in the specified version and later.
 *
 * @param version The version when the return type change takes effect. The new return type applies
 *                from this version onwards, while the old return type applies to earlier versions.
 * @param oldType The previous return type used before the specified version.
 *
 * @example
 *
 * \`\`\`tsp
 * // In v1: returns a string
 * // In v2+: returns an int32
 * @returnTypeChangedFrom(Versions.v2, string)
 * op getUserId(): int32;
 * \`\`\`
 */
extern dec returnTypeChangedFrom(target: Operation, version: EnumMember, oldType: unknown);
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/traits.tsp":`import "@typespec/versioning";

namespace Azure.Core.Traits;

using Reflection;
using Versioning;

/**
 * Enumerates the standard trait locations for Azure.Core operations.
 */
@doc("Enumerates the standard trait locations for Azure.Core operations.")
enum TraitLocation {
  @doc("Identifies operation parameters as the trait target.")
  Parameters,

  @doc("Identifies operation response as the trait target.")
  Response,

  @doc("Identifies the API version parameter as the trait target.")
  ApiVersionParameter,
}

/**
 * Enumerates the standard trait contexts for Azure.Core operations.
 */
@doc("")
enum TraitContext {
  @doc("Trait is applicable for resource 'read' operations.")
  Read,

  @doc("Trait is applicable for resource 'create' operations.")
  Create,

  @doc("Trait is applicable for resource 'update' operations.")
  Update,

  @doc("Trait is applicable for resource 'delete' operations.")
  Delete,

  @doc("Trait is applicable for resource 'list' operations.")
  List,

  @doc("Trait is applicable for resource actions.")
  Action,

  @doc("Only traits that did not specify a trait context (and therefore always apply) will be exposed.")
  Undefined,
}

/**
 * Used to override a trait.
 * @template Trait The trait to override.
 */
@Private.applyTraitOverride(Trait)
model TraitOverride<Trait extends Model> {}

/**
 * Declares a trait that is applied as a query parameter.
 * @template Parameters The name of the query parameter.
 * @template Contexts The contexts in which the trait is applicable.
 */
@trait
@Private.ensureAllQueryParams(Parameters)
model QueryParametersTrait<Parameters extends Model, Contexts = unknown> {
  @traitContext(Contexts)
  queryParams: {
    @traitLocation(TraitLocation.Parameters)
    parameters: Parameters;
  };
}

/**
 * Declares a trait that is applied as a query parameter for list operations.
 * @template Parameters Object describing the query parameters.
 */
@trait
model ListQueryParametersTrait<Parameters extends Model>
  is QueryParametersTrait<Parameters, TraitContext.List>;

/**
 * Declares a trait that is applied as a request header parameter.
 * @template Headers Object describing the request header parameters.
 * @template Contexts The contexts in which the trait is applicable.
 */
@trait
@Private.ensureAllHeaderParams(Headers)
model RequestHeadersTrait<Headers extends Model, Contexts = unknown> {
  @traitContext(Contexts)
  requestHeaders: {
    @traitLocation(TraitLocation.Parameters)
    parameters: Headers;
  };
}

/**
 * Declares a trait that is applied as a response header parameter.
 * @template Headers Object describing the response header parameters.
 * @template Contexts The contexts in which the trait is applicable.
 */
@trait
@Private.ensureAllHeaderParams(Headers)
model ResponseHeadersTrait<Headers extends Model, Contexts = unknown> {
  @traitContext(Contexts)
  responseHeaders: {
    @traitLocation(TraitLocation.Response)
    parameters: Headers;
  };
}

/**
 * Declares a version parameter trait.
 * @template VersionParameter The type of the version parameter.
 */
@trait("VersionParameter")
model VersionParameterTrait<VersionParameter> {
  versionParameter: {
    @traitLocation(TraitLocation.ApiVersionParameter)
    apiVersionParam: VersionParameter;
  };
}

/**
 * Provides clientRequestId headers for requests and responses.
 * @template VersionAdded The version when the trait was added to the specification.
 *           Leave this empty if the trait is always supported.
 */
@trait("ClientRequestId")
@traitAdded(VersionAdded)
model SupportsClientRequestId<VersionAdded extends EnumMember | null = null> {
  #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This inline model is never used directly in operations."
  clientRequestId: {
    @traitLocation(TraitLocation.Parameters)
    parameters: ClientRequestIdHeader;

    @traitLocation(TraitLocation.Response)
    response: ClientRequestIdHeader;
  };
}

/**
 * Indicates that the service or operation does not support clientRequestId headers.
 */
@trait("ClientRequestId")
model NoClientRequestId {
  clientRequestId: {};
}

/**
 * Provides conditional request headers for requests and ETag headers for responses.
 * @template VersionAdded The version when the trait was added to the specification.
 *           Leave this empty if the trait is always supported.
 */
@trait("ConditionalRequests")
@traitAdded(VersionAdded)
model SupportsConditionalRequests<VersionAdded extends EnumMember | null = null> {
  #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This inline model is never used directly in operations."
  conditionalRequests: {
    @traitContext(
      TraitContext.Read | TraitContext.Update | TraitContext.Delete | TraitContext.Create
    )
    @traitLocation(TraitLocation.Parameters)
    parameters: ConditionalRequestHeaders;

    @traitContext(TraitContext.Read | TraitContext.Create | TraitContext.Update)
    @traitLocation(TraitLocation.Response)
    response: EtagResponseEnvelope;
  };
}

/**
 * Indicates that the service or operation does not support conditional requests.
 */
@trait("ConditionalRequests")
model NoConditionalRequests {
  conditionalRequests: {};
}

/**
 * Provides repeatable request headers for requests and responses.
 * @template VersionAdded The version when the trait was added to the specification.
 *           Leave this empty if the trait is always supported.
 */
@trait("RepeatableRequests")
@traitAdded(VersionAdded)
model SupportsRepeatableRequests<VersionAdded extends EnumMember | null = null> {
  #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This inline model is never used directly in operations."
  @traitContext(
    TraitContext.Create | TraitContext.Update | TraitContext.Delete | TraitContext.Action
  )
  repeatableRequests: {
    @traitLocation(TraitLocation.Parameters)
    parameters: RepeatabilityRequestHeaders;

    @traitLocation(TraitLocation.Response)
    response: RepeatabilityResponseHeaders;
  };
}

/**
 * Indicates that the service or operation does not support repeatable requests.
 */
@trait("RepeatableRequests")
model NoRepeatableRequests {
  repeatableRequests: {};
}

/**
 * \`@trait\` marks a model type as representing a 'trait' and performs basic validation
 * checks.
 *
 * @param target The model type to mark as a trait.
 * @param traitName An optional name to uniquely identify the trait.  If unspecified,
 *        the model type name is used.
 */
extern dec \`trait\`(target: Model, traitName?: valueof string);

/**
 * \`@traitContext\` sets the applicable context for a trait on its envelope property.
 *
 * @param target The trait envelope property where the context will be applied.
 * @param contexts An enum member or union of enum members representing the trait's
 *        applicable contexts.
 */
extern dec traitContext(target: ModelProperty, contexts: EnumMember | Union | unknown);

/**
 * \`@traitLocation\` sets the applicable location for a trait on its envelope property.
 *
 * @param target The trait envelope property where the context will be applied.
 * @param contexts An enum member or union of enum members representing the trait's
 *        applicable contexts.
 */
extern dec traitLocation(target: ModelProperty, contexts: EnumMember);

/**
 * Sets the version for when the trait was added to the specification.  Can be applied
 * to either a trait model type or its envelope property.
 * @param addedVersion The enum member representing the service version.
 */
extern dec traitAdded(target: Model | ModelProperty, addedVersion: EnumMember | null);

namespace Private {
  @Private.addTraitProperties(Traits, Location, Contexts)
  model TraitProperties<
    Traits extends Model,
    Location extends TypeSpec.Reflection.EnumMember,
    Contexts = unknown
  > {}

  @doc("Contains the details of a specific trait expected by an interface or operation.")
  model ExpectedTrait {
    @doc("The name of the expected trait.")
    trait: string;

    @doc("The diagnostic to be raised when the trait is not present.")
    diagnostic: string;
  }

  /**
   * \`@traitSource\` stores the \`traitName\` of its original trait on the envelope property.
   *
   * @param target The trait envelope property where \`traitName\` will be stored.
   * @param traitName The name of the original trait to which this property belongs.
   */
  extern dec traitSource(target: ModelProperty, traitName: valueof string);

  /**
   * Copies trait properties from \`traitModel\` into \`target\` which conform to the
   * specified location and contexts.
   * @param traitModel The trait model type to be applied.
   * @param traitLocation The trait location to use for selecting trait properties.
   * @param traitContexts The trait contexts to use for selecting trait properties.
   */
  extern dec addTraitProperties(
    target: Model,
    traitModel: Model,
    traitLocation: EnumMember,
    traitContexts: EnumMember | Union | unknown
  );

  /**
   * \`@applyTraitOverride\` copies the \`traitModel\` into \`target\` and renames its envelope
   * property to enable the trait to override another trait sharing the same name.
   *
   * @param target The model into which the trait will be copied.
   * @param traitModel The trait model type to be overridden.
   */
  extern dec applyTraitOverride(target: Model, traitModel: Model);

  /**
   * \`@ensureTraitsPresent\` checks the envelope properties of \`traitModel\` to ensure all
   * of the \`expectedTraits\` are present as envelope properties.
   *
   * @param target The interface or operation where the \`traitModel\` should be checked.
   * @param traitModel The trait model type to check.
   * @param expectedTraits The array of \`ExpectedTrait\` models which describe each expected trait.
   */
  extern dec ensureTraitsPresent(
    target: Interface | TypeSpec.Reflection.Operation,
    traitModel: Model,
    expectedTraits: ExpectedTrait[]
  );

  /**
   * \`@ensureAllQueryParams\` checks the properties of \`paramModel\` to ensure they all are marked
   * with the \`@query\` decorator.
   *
   * @param target The model type where this check will be established.
   * @param paramModel The actual model type to check for query parameters.
   */
  extern dec ensureAllQueryParams(target: Model, paramModel: Model);

  /**
   * \`@ensureAllHeaderParams\` checks the properties of \`paramModel\` to ensure they all are marked
   * with the \`@header\` decorator.
   *
   * @param target The model type where this check will be established.
   * @param paramModel The actual model type to check for header properties.
   */
  extern dec ensureAllHeaderParams(target: Model, paramModel: Model);
}
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/foundations.tsp":`import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "./traits.tsp";

using Http;
using Rest;
using Versioning;
using Azure.Core.Traits;
using Azure.Core.Traits.Private;

namespace Azure.Core.Foundations;

/**
 * Enum describing allowed operation states.
 */
@lroStatus
union OperationState {
  @doc("The operation has not started.")
  NotStarted: "NotStarted",

  @doc("The operation is in progress.")
  Running: "Running",

  @doc("The operation has completed successfully.")
  Succeeded: "Succeeded",

  @doc("The operation has failed.")
  Failed: "Failed",

  @doc("The operation has been canceled by the user.")
  Canceled: "Canceled",

  string,
}

/**
 * Provides status details for long running operations.
 * @template StatusResult The type of the operation status result.
 * @template StatusError The type of the operation status error. If not provided, the default error is used.
 */
@doc("Provides status details for long running operations.")
model OperationStatus<StatusResult = never, StatusError = Foundations.Error> {
  @key("operationId")
  @doc("The unique ID of the operation.")
  id: string;

  @doc("The status of the operation")
  status: OperationState;

  @doc("Error object that describes the error when status is \\"Failed\\".")
  error?: StatusError;

  @doc("The result of the operation.")
  result?: StatusResult;
}

/**
 * Conveys the resource instance to an operation as a request body.
 * @template Resource The type of the resource instance.
 */
@doc("Conveys the resource instance to an operation as a request body.")
model ResourceBody<Resource> {
  @doc("The resource instance.")
  @body
  resource: Resource;
}

// TODO: There is a ARM linter rule that verifies that
// there is no response body. However, long running
// operations are allowed to have it.
alias ResourceCreatedResponse<Resource extends TypeSpec.Reflection.Model> = TypeSpec.Http.Response<201> &
  Resource;

alias ResourceOkResponse<Resource> = TypeSpec.Http.Response<200> & Resource;

alias ResourceCreatedOrOkResponse<Resource extends TypeSpec.Reflection.Model> =
  | ResourceCreatedResponse<Resource>
  | ResourceOkResponse<Resource>;

/**
 * Response describing the location of a created resource.
 * @template T The type of the created resource.
 */
model LocationOfCreatedResourceResponse<Resource extends TypeSpec.Reflection.Model>
  is TypeSpec.Http.CreatedResponse {
  @finalLocation
  @TypeSpec.Http.header("Location")
  location: ResourceLocation<Resource>;
}

/**
 * Response describing the location of a resource created with a service-provided name.
 * @template T The type of the created resource.
 */
model LocationOfCreatedResourceWithServiceProvidedNameResponse<Resource extends TypeSpec.Reflection.Model>
  is TypeSpec.Http.AcceptedResponse {
  @finalLocation
  @TypeSpec.Http.header("Location")
  location: ResourceLocation<Resource>;
}

/**
 * Metadata for long running operation status monitor locations.
 * @template StatusResult The type of the operation status result.
 */
@doc("Metadata for long running operation status monitor locations")
model LongRunningStatusLocation<StatusResult = never> {
  @pollingLocation
  @doc("The location for monitoring the operation state.")
  @TypeSpec.Http.header("Operation-Location")
  operationLocation: ResourceLocation<OperationStatus<StatusResult>>;
}

alias AcceptedResponse<Resource = {}> = TypeSpec.Http.AcceptedResponse & Resource;

/**
 * A response containing error details.
 * @template Error The type of the error object.
 */
@error
@doc("A response containing error details.")
model ErrorResponseBase<Error> {
  @doc("The error object.")
  error: Error;

  @header("x-ms-error-code")
  @doc("String error code indicating what went wrong.")
  errorCode?: string;
}

model ErrorResponse is ErrorResponseBase<Error>;

@doc("The ApiVersion query parameter.")
model ApiVersionParameter {
  @query("api-version")
  @minLength(1)
  @doc("The API version to use for this operation.")
  apiVersion: string;
}

@doc("The retry-after envelope.")
model RetryAfterHeader {
  @doc("The Retry-After header can indicate how long the client should wait before polling the operation status.")
  @header("Retry-After")
  retryAfter?: int32;
}

@doc("The error object.")
model Error {
  @doc("One of a server-defined set of error codes.")
  code: string;

  @doc("A human-readable representation of the error.")
  message: string;

  @doc("The target of the error.")
  target?: string;

  #suppress "@azure-tools/typespec-providerhub/no-identifier-property-in-array-item" "Error items have no unique identifier."
  @doc("An array of details about specific errors that led to this reported error.")
  details?: Error[];

  @doc("An object containing more specific information than the current object about the error.")
  innererror?: InnerError;
}

@doc("An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.")
model InnerError {
  @doc("One of a server-defined set of error codes.")
  code?: string;

  @doc("Inner error.")
  innererror?: InnerError;
}

/**
 * Version of a model for a create or replace operation which only includes updateable properties.
 * @template Resource The type of the resource.
 */
@omitKeyProperties
model ResourceCreateOrReplaceModel<Resource extends TypeSpec.Reflection.Model>
  is UpdateableProperties<DefaultKeyVisibility<Resource, Lifecycle.Read>>;

/**
 * Collection of properties from a resource that are visible to create or update scopes.
 * @template Resource The type of the resource.
 */
@withVisibility(Lifecycle.Create, Lifecycle.Update)
model CreateableAndUpdateableProperties<Resource> {
  ...Resource;
}

/**
 * Version of a model for a create or update operation which only includes updateable properties.
 * @template Resource The type of the resource.
 */
@omitKeyProperties
model ResourceCreateOrUpdateModel<Resource>
  is OptionalProperties<CreateableAndUpdateableProperties<DefaultKeyVisibility<
    Resource,
    Lifecycle.Read
  >>>;

/**
 * Version of a model for an update operation which only includes updateable properties.
 * @template Resource The type of the resource.
 */
@omitKeyProperties
model ResourceUpdateModel<Resource>
  is OptionalProperties<UpdateableProperties<DefaultKeyVisibility<Resource, Lifecycle.Read>>>;

/**
 * A model containing the keys of the provided resource.
 * @template Resource The type of the resource.
 */
@copyResourceKeyParameters
model ItemKeysOf<Resource> {}

/**
 * A model containing the collection keys of the provided resource's parent resource.
 * @template Resource The type of the resource.
 */
@copyResourceKeyParameters("parent")
model CollectionKeysOf<Resource> {}

/**
 * A model describing a set of custom request parameters.
 * @template Custom An object describing custom request parameters.
 */
@Private.spreadCustomParameters(Custom)
model CustomParameters<Custom extends TypeSpec.Reflection.Model> {}

/**
 * A model describing a set of custom response properties.
 * @template Custom An object describing custom response properties.
 */
@Private.spreadCustomResponseProperties(Custom)
model CustomResponseFields<Custom extends TypeSpec.Reflection.Model> {}

/**
 * A model describing a customized page of resources.
 * @template Resource The type of the resource.
 * @template Traits Traits which apply to the page.
 */
@friendlyName("Paged{name}", Resource)
@doc("Paged collection of {name} items", Resource)
model CustomPage<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> {
  @doc("The {name} items on this page", Resource)
  @pageItems
  value: Resource[];

  @doc("The link to the next page of items")
  @nextLink
  nextLink?: ResourceLocation<Resource>;

  // Include custom response fields
  ...TraitProperties<Traits, TraitLocation.Response, TraitContext.List>;
}

/**
 * The expected shape of model types passed to the Custom parameter of operation signatures.
 */
@doc("The expected shape of model types passed to the Custom parameter of operation signatures.")
model CustomizationFields {
  @doc("An object containing custom parameters that will be included in the operation.")
  parameters?: {};

  @doc("An object containing custom properties that will be included in the response.")
  response?: {};
}

// Basic Operation Shapes

/**
 * The most basic operation.
 * @template Parameters Object describing the request parameters of the operation.
 * @template Response Object describing the response properties of the operation.
 * @template Traits Traits which apply to the operation.
 * @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
 */
op Operation<
  Parameters extends TypeSpec.Reflection.Model,
  Response,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
>(
  ...TraitProperties<
    Traits & VersionParameterTrait<ApiVersionParameter>,
    TraitLocation.ApiVersionParameter
  >,
  ...Parameters,
): Response | ErrorResponse;

/**
 * Long-running operation.
 * @template Parameters Object describing the request parameters of the operation.
 * @template Response Object describing the response properties of the operation. If not provided, the AcceptedResponse type will be used.
 * @template Traits Traits which apply to the operation.
 * @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
 */
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
op LongRunningOperation<
  Parameters extends TypeSpec.Reflection.Model,
  Response = AcceptedResponse,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> is Operation<Parameters, Response & Foundations.LongRunningStatusLocation, Traits, ErrorResponse>;

/**
 * Operation that returns the status of another operation.
 * @template Parameters Object describing the request parameters of the operation.
 * @template StatusResult The type of the operation status result.
 * @template StatusError The type of the operation status error.
 * @template Traits Traits which apply to the operation.
 * @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
 */
op GetOperationStatus<
  Parameters = {},
  StatusResult = never,
  StatusError = Error,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> is Foundations.Operation<
  Parameters & {
    @doc("The unique ID of the operation.")
    @path
    operationId: string;
  },
  OperationStatus<StatusResult, StatusError>,
  Traits,
  ErrorResponse
>;

// Fundamental Resource Operation Shapes

/**
 * The most basic operation that applies to a resource.
 * @template Resource The type of the resource.
 * @template Parameters Object describing the request parameters of the operation.
 * @template Response Object describing the response properties of the operation.
 * @template Traits Traits which apply to the operation.
 * @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
 */
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "This operation must return a status monitor in its response."
@autoRoute
@Private.ensureResourceType(Resource)
op ResourceOperation<
  Resource extends TypeSpec.Reflection.Model,
  Parameters extends TypeSpec.Reflection.Model,
  Response,  // No constraint here on purpose, some responses are unions
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> is Operation<Foundations.ItemKeysOf<Resource> & Parameters, Response, Traits, ErrorResponse>;

/**
 * Operation that applies to a collection of resources.
 * @template Resource The type of the resource.
 * @template Parameters Object describing the request parameters of the operation.
 * @template Response Object describing the response properties of the operation.
 * @template Traits Traits which apply to the operation.
 * @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
 */
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "This operation must return a status monitor in its response."
@autoRoute
@Private.ensureResourceType(Resource)
op ResourceCollectionOperation<
  Resource extends TypeSpec.Reflection.Model,
  Parameters extends TypeSpec.Reflection.Model,
  Response extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> is Operation<
  Foundations.CollectionKeysOf<Resource> & Parameters,
  Response,
  Traits,
  ErrorResponse
>;

/**
 * Operation that lists resources in a paginated way.
 * @template Resource The type of the resource.
 * @template Parameters Object describing the request parameters of the operation.
 * @template Response Object describing the response properties of the operation.
 * @template Traits Traits which apply to the operation.
 * @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
 */
@listsResource(Resource)
@list
@Private.ensureResourceType(Resource)
op ResourceList<
  Resource extends TypeSpec.Reflection.Model,
  Parameters extends TypeSpec.Reflection.Model,
  Response extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> is ResourceCollectionOperation<Resource, Parameters, Response, Traits, ErrorResponse>;

/**
 * Operation that lists resources in a non-paginated way.
 * @template Resource The type of the resource.
 * @template Traits Traits which apply to the operation.
 * @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
 */
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
@autoRoute
@listsResource(Resource)
@Private.ensureResourceType(Resource)
op NonPagedResourceList<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> is ResourceCollectionOperation<
  Resource,
  TraitProperties<Traits, TraitLocation.Parameters, TraitContext.List>,
  Body<Resource[]> & TraitProperties<Traits, TraitLocation.Response, TraitContext.List>,
  Traits,
  ErrorResponse
>;

/**
 * Long-running operation that updates a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits which apply to the operation.
 * @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
 */
@updatesResource(Resource)
op LongRunningResourceUpdate<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> is Foundations.ResourceOperation<
  Resource,
  {
    @doc("This request has a JSON Merge Patch body.")
    @TypeSpec.Http.header("Content-Type")
    contentType: "application/merge-patch+json";

    ...Foundations.ResourceBody<Resource>;
    ...TraitProperties<Traits, TraitLocation.Parameters, TraitContext.Update>;
  },
  Foundations.ResourceOkResponse<Resource &
    TraitProperties<Traits, TraitLocation.Response, TraitContext.Update> &
    Foundations.LongRunningStatusLocation<Resource>>,
  Traits,
  ErrorResponse
>;
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/models.tsp":`import "@typespec/http";
import "@typespec/rest";
import "./traits.tsp";

using Http;
using Rest;

namespace Azure.Core;

/**
 * Describes a page of resource object.
 * @template Resource The resource type.
 */
@friendlyName("Paged{name}", Resource)
@doc("Paged collection of {name} items", Resource)
model Page<Resource extends TypeSpec.Reflection.Model> {
  @doc("The {name} items on this page", Resource)
  @pageItems
  value: Resource[];

  @doc("The link to the next page of items")
  @nextLink
  nextLink?: ResourceLocation<Resource>;
}

/**
 * Defines a property as a request parameter.
 * @template Name The parameter name.
 */
@Foundations.requestParameter(Name)
model RequestParameter<Name extends valueof string> {}

/**
 * Defines a property as a response header.
 * @template Name The header name.
 */
@Foundations.responseProperty(Name)
model ResponseProperty<Name extends valueof string> {}

/**
 * @dev Provides the status of a resource operation.
 * @template Resource The resource type.
 * @template StatusResult Model describing the status result object. If not specified, the default is the resource type.
 * @template StatusError Model describing the status error object. If not specified, the default is the Foundations.Error.
 */
@resource("operations")
@parentResource(Resource)
model ResourceOperationStatus<
  Resource extends TypeSpec.Reflection.Model,
  StatusResult = Resource,
  StatusError = Foundations.Error
> is Azure.Core.Foundations.OperationStatus<StatusResult, StatusError>;

#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This is acceptable in Azure.Core."
alias ResourceOperationStatusResponse<
  Resource extends TypeSpec.Reflection.Model,
  StatusResult,
  StatusError
> = ResourceOperationStatus<Resource, StatusResult, StatusError>;

@doc("Provides the standard 'top' query parameter for list operations.")
model TopQueryParameter {
  @query
  @doc("The number of result items to return.")
  top?: int32;
}

@doc("Provides the standard 'skip' query parameter for list operations.")
model SkipQueryParameter {
  @query
  @offset
  @doc("The number of result items to skip.")
  skip?: int32 = 0;
}

@doc("Provides the standard 'maxpagesize' query parameter for list operations.")
model MaxPageSizeQueryParameter {
  @query
  @pageSize
  @doc("The maximum number of result items per page.")
  maxpagesize?: int32;
}

@doc("Provides the standard 'filter' query parameter for list operations")
model FilterParameter {
  @query
  @doc("The maximum number of result items per page.")
  filter?: string;
}

@doc("Provides the standard 'orderby' query parameter for list operations.")
model OrderByQueryParameter {
  @query(#{ explode: true })
  @doc("Expressions that specify the order of returned results.")
  orderby?: string[];
}

@doc("Provides the standard 'filter' query parameter for list operations.")
model FilterQueryParameter {
  @query
  @doc("Filter the result list using the given expression.")
  filter?: string;
}

@doc("Provides the standard 'select' query parameter for list operations.")
model SelectQueryParameter {
  @query(#{ explode: true })
  @doc("Select the specified fields to be included in the response.")
  select?: string[];
}

@doc("Provides the standard 'expand' query parameter for list operations.")
model ExpandQueryParameter {
  @query(#{ explode: true })
  @doc("Expand the indicated resources into the response.")
  expand?: string[];
}

@doc("Provides the most common query parameters for list operations.")
model StandardListQueryParameters {
  ...TopQueryParameter;
  ...SkipQueryParameter;
  ...MaxPageSizeQueryParameter;
}

// https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#conditional-requests

@doc("Provides the 'If-*' headers to enable conditional (cached) responses")
model ConditionalRequestHeaders {
  @visibility(Lifecycle.Read, Lifecycle.Query, Lifecycle.Create, Lifecycle.Update, Lifecycle.Delete)
  @header("If-Match")
  @doc("The request should only proceed if an entity matches this string.")
  ifMatch?: string;

  @visibility(Lifecycle.Read, Lifecycle.Query, Lifecycle.Create, Lifecycle.Update, Lifecycle.Delete)
  @header("If-None-Match")
  @doc("The request should only proceed if no entity matches this string.")
  ifNoneMatch?: string;

  @visibility(Lifecycle.Read, Lifecycle.Query, Lifecycle.Create, Lifecycle.Update, Lifecycle.Delete)
  @header("If-Unmodified-Since")
  @doc("The request should only proceed if the entity was not modified after this time.")
  ifUnmodifiedSince?: utcDateTime;

  @visibility(Lifecycle.Read, Lifecycle.Query, Lifecycle.Create, Lifecycle.Update, Lifecycle.Delete)
  @header("If-Modified-Since")
  @doc("The request should only proceed if the entity was modified after this time.")
  ifModifiedSince?: utcDateTime;
}

@doc("""
  Provides the 'ETag' field to enable conditional (cached) requests.  This model can be spread
  into responses and item models to convey the ETag when it cannot simply conveyed in a header.
  """)
model EtagProperty {
  @visibility(Lifecycle.Read)
  @doc("The entity tag for this resource.")
  etag: eTag;
}

@doc("Provides the 'ETag' header to enable conditional (cached) requests")
model EtagResponseEnvelope {
  @header("ETag")
  @visibility(Lifecycle.Read)
  @doc("The entity tag for the response.")
  etagHeader?: string;
}

// https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#repeatability-of-requests

@doc("Provides the 'Repeatability-*' headers to enable repeatable requests.")
model RepeatabilityRequestHeaders {
  @visibility(Lifecycle.Create, Lifecycle.Update, Lifecycle.Delete)
  @header("Repeatability-Request-ID")
  @doc("An opaque, globally-unique, client-generated string identifier for the request.")
  repeatabilityRequestId?: string;

  @visibility(Lifecycle.Create, Lifecycle.Update, Lifecycle.Delete)
  @doc("Specifies the date and time at which the request was first created.")
  @header("Repeatability-First-Sent")
  repeatabilityFirstSent?: utcDateTime;
}

@doc("Provides the 'Repeatability-*' headers to enable repeatable requests.")
model RepeatabilityResponseHeaders {
  @visibility(Lifecycle.Read)
  @header("Repeatability-Result")
  @doc("Indicates whether the repeatable request was accepted or rejected.")
  repeatabilityResult?: RepeatabilityResult;
}

/** Repeatability Result header options */
union RepeatabilityResult {
  /** If the request was accepted and the server guarantees that the server state reflects a single execution of the operation. */
  "accepted",

  /**
   * If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid
   *  or because the Repeatability-First-Sent value was outside the range of values held by the server.
   */
  "rejected",
}

// https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#distributed-tracing--telemetry

@doc("Provides the 'x-ms-client-request-id' header to enable request correlation in requests and responses.")
model ClientRequestIdHeader {
  @header("x-ms-client-request-id")
  @doc("An opaque, globally-unique, client-generated string identifier for the request.")
  clientRequestId?: uuid;
}

@doc("Provides the 'x-ms-request-id' header to enable request correlation in responses.")
model RequestIdResponseHeader {
  @visibility(Lifecycle.Read)
  @header("x-ms-request-id")
  @doc("An opaque, globally-unique, server-generated string identifier for the request.")
  requestId?: uuid;
}

/**
 * A vector embedding frequently used in similarity search.
 * @template Element The element type of the embedding vector.
 */
@Foundations.Private.embeddingVector(Element)
model EmbeddingVector<Element extends numeric = float32> is Array<Element>;

/**
 * Options for overriding a polling endpoint that uses a StatusMonitor
 * @template PollingModel The model that is returned when polling should continue.
 * @template FinalResult The model that is returned when polling terminates successfully.
 * @template FinalProperty The property of the status monitor that contains results.
 */
model StatusMonitorPollingOptions<
  PollingModel extends TypeSpec.Reflection.Model | void = never,
  FinalResult extends TypeSpec.Reflection.Model | unknown | void = never,
  FinalProperty extends TypeSpec.Reflection.ModelProperty | string = never
> extends StatusMonitorOptions {
  /** The kind of polling options */
  kind: PollingOptionKind.statusMonitor;

  /** The model that is returned when polling should continue */
  pollingModel: PollingModel;

  /** The model that is returned when polling terminates successfully */
  finalResult: FinalResult;

  /** The property of the status monitor that contains results */
  finalProperty: FinalProperty;
}

/** Options for Lro status monitors. */
model StatusMonitorOptions extends PollingOptions {
  /** The kind of polling options */
  kind: PollingOptionKind.statusMonitor;

  /** A reference to or name of the property of the status monitor that contains the response */
  finalProperty?: TypeSpec.Reflection.ModelProperty | string;
}

/** Generic polling options for LRO operations. */
model PollingOptions {
  /** The kind of polling options */
  kind: PollingOptionKind;

  /** The model that is returned when polling should continue. */
  pollingModel?: TypeSpec.Reflection.Model | void;

  /** The type that is returned when polling terminates successfully. */
  finalResult?: TypeSpec.Reflection.Model | unknown | void;
}

/** The available kinds of polling options */
union PollingOptionKind {
  /** Polling options for a status monitor */
  statusMonitor: "statusMonitor",

  string,
}

/**
 * Universally Unique Identifier
 *
 * @example
 *
 * \`\`\`
 * 123e4567-e89b-12d3-a456-426614174000
 * \`\`\`
 */
@format("uuid")
scalar uuid extends string;

/**
 * Represent an IP V4 address serialized as a string.
 *
 * It is formatted as four 8-bit fields separated by periods.
 *
 * @example
 *
 * \`\`\`
 * 129.144.50.56
 * \`\`\`
 */
#suppress "@azure-tools/typespec-autorest/unknown-format" "Foundation."
@format("ipV4Address")
scalar ipV4Address extends string;

/**
 * Represent an IP V6 address serialized as a string.
 *
 * It is formatted as eight hex decimal values(16-bit) between 0 and FFFF separated by colon. (i.e. \`y:y:y:y:y:y:y:y\`)
 *
 * @example
 *
 * \`\`\`
 * 2001:db8:3333:4444:CCCC:DDDD:EEEE:FFFF
 * \`\`\`
 */
#suppress "@azure-tools/typespec-autorest/unknown-format" "Foundation."
@format("ipV6Address")
scalar ipV6Address extends string;

/**
 * The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource.
 * It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed.
 *
 * It is a string of ASCII characters placed between double quotes, like "675af34563dc-tr34".
 *
 * @example In \`ETag\` header
 *
 * \`\`\`
 * ETag: "675af34563dc-tr34"
 * \`\`\`
 */
#suppress "@azure-tools/typespec-autorest/unknown-format" "Foundation."
@format("eTag")
scalar eTag extends string;

/**
 * Represents an Azure geography region where supported resource providers live.
 *
 * @example
 *
 * \`\`\`
 * WestUS
 * \`\`\`
 */
scalar azureLocation extends string;

/**
 * Represents an Azure Resource Type.
 *
 * @example
 *
 * \`\`\`
 * Microsoft.Network/virtualNetworks/subnets
 * \`\`\`
 */
scalar armResourceType extends string;

/**
 * A type definition that refers the id to an Azure Resource Manager resource.
 *
 * @template AllowedResourceTypes An array of allowed resource types for the resource reference
 *
 * @example
 *
 * \`\`\`tsp
 * model MyModel {
 *   otherArmId: armResourceIdentifier;
 *   networkId: armResourceIdentifier<[{type:"Microsoft.Network/vnet"}]>
 *   vmIds: armResourceIdentifier<[{type:"Microsoft.Compute/vm", scopes: ["*"]}]>
 *   scoped: armResourceIdentifier<[{type:"Microsoft.Compute/vm", scopes: ["Tenant", "ResourceGroup"]}]>
 * }
 * \`\`\`
 */
@doc("A type definition that refers the id to an Azure Resource Manager resource.")
@format("arm-id")
@Azure.Core.Foundations.Private.armResourceIdentifierConfig({
  allowedResources: AllowedResourceTypes,
})
scalar armResourceIdentifier<AllowedResourceTypes extends ArmResourceIdentifierAllowedResource[] = never>
  extends string;

// Consider replacing \`*\`
union ArmResourceDeploymentScope {
  "Tenant",
  "Subscription",
  "ResourceGroup",
  "ManagementGroup",
  "Extension",
}

alias AllArmResourceDeploymentScopes = [
  "Tenant",
  "Subscription",
  "ResourceGroup",
  "ManagementGroup",
  "Extension"
];

model ArmResourceIdentifierAllowedResource {
  /** The type of resource that is being referred to. For example Microsoft.Network/virtualNetworks or Microsoft.Network/virtualNetworks/subnets. See Example Types for more examples. */
  type: armResourceType;

  /**
   * An array of scopes. If not specified, the default scope is ["ResourceGroup"].
   * See [Allowed Scopes](https://github.com/Azure/autorest/tree/main/docs/extensions#allowed-scopes).
   */
  scopes?: ArmResourceDeploymentScope[];
}
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/operations.tsp":`import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "./models.tsp";
import "./traits.tsp";

namespace Azure.Core;

using Http;
using Rest;
using Versioning;
using Azure.Core.Traits;
using Azure.Core.Traits.Private;

// RPC Operations

/**
 * A remote procedure call (RPC) operation.
 * @template Parameters Object describing the parameters of the operation.
 * @template Response Object describing the response of the operation.
 * @template Traits Object describing the traits of the operation.
 * @template ErrorResponse Error response of the operation. If not specified, the default error response is used.
 * @template TraitContexts Trait contexts applicable to the operation. Defaults to \`TraitContext.Undefined\` which means that only traits that always apply will appear. Can specify multiple using the | operator.
 */
@Foundations.Private.needsRoute
op RpcOperation<
  Parameters extends TypeSpec.Reflection.Model,
  Response extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse,
  TraitContexts extends TraitContext = TraitContext.Undefined
> is Foundations.Operation<
  Parameters & TraitProperties<Traits, TraitLocation.Parameters>,
  Response & TraitProperties<Traits, TraitLocation.Response, TraitContexts>,
  Traits,
  ErrorResponse
>;

/**
 * A long-running remote procedure call (RPC) operation.
 * @template Parameters Object describing the parameters of the operation.
 * @template Response Object describing the response of the operation.
 * @template StatusResult Object describing the status result of the operation.
 * @template StatusError Error response of the status operation. If not specified, the default error response is used.
 * @template Traits Object describing the traits of the operation.
 * @template ErrorResponse Error response of the operation. If not specified, the default error response is used.
 * @template TraitContexts Trait contexts applicable to the operation. Defaults to \`TraitContext.Undefined\` which means that only traits that always apply will appear. Can specify multiple using the | operator.
 */
@Foundations.Private.needsRoute
@post
op LongRunningRpcOperation<
  Parameters extends TypeSpec.Reflection.Model,
  Response extends TypeSpec.Reflection.Model,
  StatusResult extends TypeSpec.Reflection.Model,
  StatusError = Foundations.Error,
  Traits extends TypeSpec.Reflection.Model = {},
  ErrorResponse = Azure.Core.Foundations.ErrorResponse,
  TraitContexts extends TraitContext = TraitContext.Undefined
> is Foundations.Operation<
  Parameters & TraitProperties<Traits, TraitLocation.Parameters>,
  AcceptedResponse &
    ResourceOperationStatus<Response, StatusResult, StatusError> &
    Foundations.LongRunningStatusLocation<StatusResult> &
    TraitProperties<Traits, TraitLocation.Response, TraitContexts>,
  Traits,
  ErrorResponse
>;

// Standard Resource Lifecycle Operations

alias ExpectedResourceOperationTraits = [
  {
    trait: "ConditionalRequests";
    diagnostic: "conditional-requests-trait-missing";
  },
  {
    trait: "RepeatableRequests";
    diagnostic: "repeatable-requests-trait-missing";
  },
  {
    trait: "ClientRequestId";
    diagnostic: "client-request-id-trait-missing";
  }
];

/**
 * Interface containing common resource operations.
 * @template InterfaceTraits Traits applicable to the operations.
 * @template ErrorResponse Error response of the operations. If not specified, the default error response is used.
 */
@ensureTraitsPresent(InterfaceTraits, ExpectedResourceOperationTraits)
interface ResourceOperations<
  InterfaceTraits extends TypeSpec.Reflection.Model,
  ErrorResponse = Azure.Core.Foundations.ErrorResponse
> {
  /**
   * Create or replace operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  @Foundations.Private.ensureVerb("ResourceCreateOrReplace", "PUT")
  @createsOrReplacesResource(Resource)
  ResourceCreateOrReplace<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    Foundations.ResourceBody<Resource> &
      TraitProperties<
        Traits & InterfaceTraits,
        TraitLocation.Parameters,
        TraitContext.Create | TraitContext.Update
      >,
    Foundations.ResourceCreatedOrOkResponse<Resource &
      TraitProperties<
        Traits & InterfaceTraits,
        TraitLocation.Response,
        TraitContext.Create | TraitContext.Update
      >>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Long-running resource create or replace operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  @Foundations.Private.ensureVerb("LongRunningResourceCreateOrReplace", "PUT")
  @createsOrReplacesResource(Resource)
  LongRunningResourceCreateOrReplace<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    Foundations.ResourceBody<Resource> &
      TraitProperties<
        Traits & InterfaceTraits,
        TraitLocation.Parameters,
        TraitContext.Create | TraitContext.Update
      >,
    Foundations.ResourceCreatedOrOkResponse<Resource &
      TraitProperties<
        Traits & InterfaceTraits,
        TraitLocation.Response,
        TraitContext.Create | TraitContext.Update
      > &
      Foundations.LongRunningStatusLocation>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Create or update operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
  #suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
  @Foundations.Private.ensureVerb("ResourceCreateOrUpdate", "PATCH")
  @createsOrUpdatesResource(Resource)
  @parameterVisibility(Lifecycle.Create, Lifecycle.Update)
  @patch(#{ implicitOptionality: true }) // For legacy reasons
  ResourceCreateOrUpdate<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    {
      @doc("This request has a JSON Merge Patch body.")
      @TypeSpec.Http.header("Content-Type")
      contentType: "application/merge-patch+json";

      ...Foundations.ResourceBody<Resource>;
      ...TraitProperties<
        Traits & InterfaceTraits,
        TraitLocation.Parameters,
        TraitContext.Create | TraitContext.Update
      >;
    },
    Foundations.ResourceCreatedOrOkResponse<Resource &
      TraitProperties<
        Traits & InterfaceTraits,
        TraitLocation.Response,
        TraitContext.Create | TraitContext.Update
      >>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Long-running resource create or update operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
  #suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
  @Foundations.Private.ensureVerb("LongRunningResourceCreateOrUpdate", "PATCH")
  @createsOrUpdatesResource(Resource)
  @parameterVisibility(Lifecycle.Create, Lifecycle.Update)
  @patch(#{ implicitOptionality: true }) // For legacy reasons
  LongRunningResourceCreateOrUpdate<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    {
      @doc("This request has a JSON Merge Patch body.")
      @TypeSpec.Http.header("Content-Type")
      contentType: "application/merge-patch+json";

      ...Foundations.ResourceBody<Resource>;
      ...TraitProperties<
        Traits & InterfaceTraits,
        TraitLocation.Parameters,
        TraitContext.Create | TraitContext.Update
      >;
    },
    Foundations.ResourceCreatedOrOkResponse<Resource &
      TraitProperties<
        Traits & InterfaceTraits,
        TraitLocation.Response,
        TraitContext.Create | TraitContext.Update
      > &
      Foundations.LongRunningStatusLocation<Resource>>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Resource update operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
  @Foundations.Private.ensureVerb("ResourceUpdate", "PATCH")
  @updatesResource(Resource)
  @patch(#{ implicitOptionality: true }) // For legacy reasons
  ResourceUpdate<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    {
      @doc("This request has a JSON Merge Patch body.")
      @TypeSpec.Http.header("Content-Type")
      contentType: "application/merge-patch+json";

      ...Foundations.ResourceBody<Resource>;
      ...TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Update>;
    },
    Foundations.ResourceOkResponse<Resource &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Update>>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Resource create with service-provided name operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
  @Foundations.Private.ensureVerb("ResourceCreateWithServiceProvidedName", "POST")
  @createsResource(Resource)
  ResourceCreateWithServiceProvidedName<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceCollectionOperation<
    Resource,
    Foundations.ResourceBody<Resource> &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Create>,
    Foundations.LocationOfCreatedResourceResponse<Resource> &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Create>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Long-running resource create with service-provided name operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
  @Foundations.Private.ensureVerb("LongRunningResourceCreateWithServiceProvidedName", "POST")
  @createsResource(Resource)
  LongRunningResourceCreateWithServiceProvidedName<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceCollectionOperation<
    Resource,
    Foundations.ResourceBody<Resource> &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Create>,
    Foundations.LocationOfCreatedResourceWithServiceProvidedNameResponse<Resource> &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Create>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Resource read operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  @Foundations.Private.ensureVerb("ResourceRead", "GET")
  @readsResource(Resource)
  ResourceRead<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Read>,
    Resource &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Read>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Resource delete operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
  @Foundations.Private.ensureVerb("ResourceDelete", "DELETE")
  @deletesResource(Resource)
  ResourceDelete<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Delete>,
    TypeSpec.Http.NoContentResponse &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Delete>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Long-running resource delete operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "We do support bodies in data plane service APIs..."
  @Foundations.Private.ensureVerb("LongRunningResourceDelete", "DELETE")
  @deletesResource(Resource)
  LongRunningResourceDelete<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Delete>,
    Foundations.AcceptedResponse<Foundations.OperationStatus &
      Foundations.LongRunningStatusLocation &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Delete>>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Resource list operation template.
   * @template Resource Resource type.
   * @template Traits Object describing the traits of the operation.
   */
  @Foundations.Private.ensureVerb("ResourceList", "GET")
  ResourceList<
    Resource extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceList<
    Resource,
    TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.List>,
    Foundations.CustomPage<Resource, Traits & InterfaceTraits>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Resource action operation template.
   * @template Resource Resource type.
   * @template Parameters Object describing the parameters of the operation.
   * @template Response Object describing the response of the operation.
   * @template Traits Object describing the traits of the operation.
   */
  @Foundations.Private.ensureVerb("ResourceAction", "POST")
  @action
  @actionSeparator(":")
  ResourceAction<
    Resource extends TypeSpec.Reflection.Model,
    Parameters extends TypeSpec.Reflection.Model,
    Response extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    Parameters &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Action>,
    Response &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Action>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Resource collection action operation template.
   * @template Resource Resource type.
   * @template Parameters Object describing the parameters of the operation.
   * @template Response Object describing the response of the operation.
   * @template Traits Object describing the traits of the operation.
   */
  @Foundations.Private.ensureVerb("ResourceCollectionAction", "POST")
  @collectionAction(Resource)
  @actionSeparator(":")
  ResourceCollectionAction<
    Resource extends TypeSpec.Reflection.Model,
    Parameters extends TypeSpec.Reflection.Model,
    Response extends TypeSpec.Reflection.Model,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceCollectionOperation<
    Resource,
    Parameters &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Action>,
    Response &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Action>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Long-running resource action operation template.
   * @template Resource Resource type.
   * @template Parameters Object describing the parameters of the operation.
   * @template StatusResult Object describing the status result of the operation.
   * @template StatusError Object describing the status error of the operation.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
  #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "This operation must return a status monitor in its response."
  @Foundations.Private.ensureVerb("LongRunningResourceAction", "POST")
  @action
  @actionSeparator(":")
  LongRunningResourceAction<
    Resource extends TypeSpec.Reflection.Model,
    Parameters extends TypeSpec.Reflection.Model,
    StatusResult extends TypeSpec.Reflection.Model,
    StatusError = Foundations.Error,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    Resource,
    Parameters &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Action>,
    AcceptedResponse &
      ResourceOperationStatus<Resource, StatusResult, StatusError> &
      Foundations.LongRunningStatusLocation<StatusResult> &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Action>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Long-running resource collection action operation template.
   * @template Resource Resource type.
   * @template Parameters Object describing the parameters of the operation.
   * @template StatusResult Object describing the status result of the operation.
   * @template StatusError Object describing the status error of the operation.
   * @template Traits Object describing the traits of the operation.
   */
  #suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
  #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "This operation must return a status monitor in its response."
  @Foundations.Private.ensureVerb("LongRunningResourceCollectionAction", "POST")
  @autoRoute
  @collectionAction(Resource)
  @actionSeparator(":")
  LongRunningResourceCollectionAction<
    Resource extends TypeSpec.Reflection.Model,
    Parameters extends TypeSpec.Reflection.Model,
    StatusResult extends TypeSpec.Reflection.Model,
    StatusError = Foundations.Error,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceCollectionOperation<
    Resource,
    Parameters &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Parameters, TraitContext.Action>,
    AcceptedResponse &
      ResourceOperationStatus<Resource, StatusResult, StatusError> &
      Foundations.LongRunningStatusLocation<StatusResult> &
      TraitProperties<Traits & InterfaceTraits, TraitLocation.Response, TraitContext.Action>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;

  /**
   * Resource operation status operation template.
   * @template Resource Resource type.
   * @template StatusResult Object describing the status result of the operation.
   * @template StatusError Object describing the status error of the operation.
   * @template Traits Object describing the traits of the operation.
   */
  @Foundations.Private.ensureVerb("GetResourceOperationStatus", "GET")
  @readsResource(ResourceOperationStatus<Resource>)
  @Foundations.Private.ensureResourceType(Resource)
  GetResourceOperationStatus<
    Resource extends TypeSpec.Reflection.Model,
    StatusResult = Resource,
    StatusError = Foundations.Error,
    Traits extends TypeSpec.Reflection.Model = {}
  > is Foundations.ResourceOperation<
    ResourceOperationStatus<Resource, StatusResult, StatusError>,
    {},
    ResourceOperationStatusResponse<Resource, StatusResult, StatusError>,
    Traits & InterfaceTraits,
    ErrorResponse
  >;
}

// Resource Status Monitoring

/**
 * Operation signature to retrieve a resource operation status.
 * @template Resource The type of the resource.
 * @template StatusResult Object describing the result of the status operation.
 * @template StatusError Object describing the error of the status operation. If not provided, the default error type is used.
 * @template Traits Traits to apply to the operation.
 */
@readsResource(ResourceOperationStatus<Resource>)
@Foundations.Private.ensureResourceType(Resource)
op GetResourceOperationStatus<
  Resource extends TypeSpec.Reflection.Model,
  StatusResult = Resource,
  StatusError = Foundations.Error,
  Traits extends TypeSpec.Reflection.Model = {}
> is Foundations.ResourceOperation<
  ResourceOperationStatus<Resource, StatusResult, StatusError>,
  {},
  ResourceOperationStatusResponse<Resource, StatusResult, StatusError>,
  Traits
>;
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/obsolete.tsp":`// This file contains operation template that are deprecated and shouldn't be used.
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "./models.tsp";
import "./traits.tsp";
import "./operations.tsp";

namespace Azure.Core;

using Http;
using Rest;
using Versioning;
using Azure.Core.Traits;
using Azure.Core.Traits.Private;

alias StandardResourceOperations = ResourceOperations<NoConditionalRequests &
  NoRepeatableRequests &
  NoClientRequestId>;

/**
 * DEPRECATED: Use \`ResourceCreateOrReplace\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Operation signature to create or replace a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
#deprecated "Use \`ResourceCreateOrReplace\` from a \`ResourceOperations\` interface instance."
op ResourceCreateOrReplace<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceCreateOrReplace<Resource, Traits>;

/**
 * DEPRECATED: Use \`LongRunningResourceCreateOrReplace\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Long-running operation signature to create or replace a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
#deprecated "Use \`LongRunningResourceCreateOrReplace\` from a \`ResourceOperations\` interface instance."
op LongRunningResourceCreateOrReplace<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.LongRunningResourceCreateOrReplace<Resource, Traits>;

/**
 * DEPRECATED: Use \`ResourceCreateOrUpdate\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Operation signature to create or update a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
#deprecated "Use \`LongRunningResourceCreateOrReplace\` from a \`ResourceOperations\` interface instance."
op ResourceCreateOrUpdate<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceCreateOrUpdate<Resource, Traits>;

/**
 * DEPRECATED: Use \`LongRunningResourceCreateOrUpdate\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Long-running operation signature to create or update a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
#deprecated "Use \`LongRunningResourceCreateOrUpdate\` from a \`ResourceOperations\` interface instance."
op LongRunningResourceCreateOrUpdate<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.LongRunningResourceCreateOrUpdate<Resource, Traits>;

/**
 * DEPRECATED: Use \`ResourceUpdate\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 * Operation signature to update a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
#deprecated "Use \`ResourceUpdate\` from a \`ResourceOperations\` interface instance."
op ResourceUpdate<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceUpdate<Resource, Traits>;

/**
 * DEPRECATED: Use \`ResourceCreateWithServiceProvidedName\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Operation signature to synchronously create a resource with a service-provided name.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
#deprecated "Use \`ResourceCreateWithServiceProvidedName\` from a \`ResourceOperations\` interface instance."
op ResourceCreateWithServiceProvidedName<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceCreateWithServiceProvidedName<Resource, Traits>;

/**
 * DEPRECATED: Use \`LongRunningResourceCreateWithServiceProvidedName\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Long-running operation signature to create a resource with a service-provided name.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
#deprecated "Use \`LongRunningResourceCreateWithServiceProvidedName\` from a \`ResourceOperations\` interface instance."
op LongRunningResourceCreateWithServiceProvidedName<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.LongRunningResourceCreateWithServiceProvidedName<Resource, Traits>;

/**
 * DEPRECATED: Use \`ResourceRead\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Operation signature to retrieve a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
op ResourceRead<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceRead<Resource, Traits>;

/**
 * DEPRECATED: Use \`ResourceDelete\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Operation signature to delete a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
op ResourceDelete<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceDelete<Resource, Traits>;

/**
 * DEPRECATED: Use \`LongRunningResourceDelete\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Long-running operation signature to delete a resource.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
op LongRunningResourceDelete<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.LongRunningResourceDelete<Resource, Traits>;

/**
 * DEPRECATED: Use \`ResourceList\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Operation signature to list resources in a paginated way.
 * @template Resource The type of the resource.
 * @template Traits Traits to apply to the operation.
 */
op ResourceList<
  Resource extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceList<Resource, Traits>;

/**
 * DEPRECATED: Use \`ResourceAction\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Operation signature for a resource action.
 * @template Resource The type of the resource.
 * @template Parameters Object describing the request parameters.
 * @template Response Object describing the response parameters.
 * @template Traits Traits to apply to the operation.
 */
op ResourceAction<
  Resource extends TypeSpec.Reflection.Model,
  Parameters extends TypeSpec.Reflection.Model,
  Response extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceAction<Resource, Parameters, Response, Traits>;

/**
 * DEPRECATED: Use \`ResourceCollectionAction\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Operation signature for an action that applies to a collection of resources.
 * @template Resource The type of the resource.
 * @template Parameters Object describing the request parameters.
 * @template Response Object describing the response parameters.
 * @template Traits Traits to apply to the operation.
 */
op ResourceCollectionAction<
  Resource extends TypeSpec.Reflection.Model,
  Parameters extends TypeSpec.Reflection.Model,
  Response extends TypeSpec.Reflection.Model,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.ResourceCollectionAction<Resource, Parameters, Response, Traits>;

/**
 * DEPRECATED: Use \`LongRunningResourceAction\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Long-running operation signature for a resource action.
 * @template Resource The type of the resource.
 * @template Parameters Object describing the request parameters.
 * @template StatusResult Object describing the result of the status operation.
 * @template StatusError Object describing the error of the status operation. If not provided, the default error type is used.
 * @template Traits Traits to apply to the operation.
 */
op LongRunningResourceAction<
  Resource extends TypeSpec.Reflection.Model,
  Parameters extends TypeSpec.Reflection.Model,
  StatusResult extends TypeSpec.Reflection.Model,
  StatusError = Foundations.Error,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.LongRunningResourceAction<
  Resource,
  Parameters,
  StatusResult,
  StatusError,
  Traits
>;

/**
 * DEPRECATED: Use \`LongRunningResourceCollectionAction\` from a \`ResourceOperations\` interface instance.
 * This can be done by instantiating your own version with the traits you want \`alias Operations = Azure.Core.ResourceOperations<ServiceTraits>;\`.
 * See https://azure.github.io/typespec-azure/docs/getstarted/azure-core/step05#defining-the-operation-interface for details on how to use.
 *
 * Long-running operation signature for an action that applies to a collection of resources.
 * @template Resource The type of the resource.
 * @template Parameters Object describing the request parameters.
 * @template StatusResult Object describing the result of the status operation.
 * @template StatusError Object describing the error of the status operation. If not provided, the default error type is used.
 * @template Traits Traits to apply to the operation.
 */
op LongRunningResourceCollectionAction<
  Resource extends TypeSpec.Reflection.Model,
  Parameters extends TypeSpec.Reflection.Model,
  StatusResult extends TypeSpec.Reflection.Model,
  StatusError = Foundations.Error,
  Traits extends TypeSpec.Reflection.Model = {}
> is StandardResourceOperations.LongRunningResourceCollectionAction<
  Resource,
  Parameters,
  StatusResult,
  StatusError,
  Traits
>;
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/decorators.tsp":`using Reflection;

namespace Azure.Core {
  /**
   * Decorator that marks a Version EnumMember as a preview version.
   * This is used to indicate that the version is not yet stable and may change in future releases.

   * @param target The EnumMember that represents the preview version.
   * @example
   * \`\`\`typespec
   * @versioned(Versions)
   * @service(#{ title: "Widget Service" })
   * namespace DemoService;
   *
   * enum Versions {
   *   v1,
   *   v2,
   *   @previewVersion
   *   v3Preview
   * }
   * \`\`\`
   *
   */
  extern dec previewVersion(target: TypeSpec.Reflection.EnumMember);

  /**
   * Used for custom StatusMonitor implementation.
   * Identifies an Enum or ModelProperty as containing long-running operation
   * status.
   */
  extern dec lroStatus(entity: Enum | Union | ModelProperty);

  /**
   * Used for custom StatusMonitor implementation.
   * Identifies an EnumMember as a long-running "Succeeded" terminal state.
   */
  extern dec lroSucceeded(entity: EnumMember | UnionVariant);

  /**
   * Used for custom StatusMonitor implementation.
   * Identifies an EnumMember as a long-running "Canceled" terminal state.
   */
  extern dec lroCanceled(entity: EnumMember | UnionVariant);

  /**
   * Used for custom StatusMonitor implementation.
   * Identifies an enum member as a long-running "Failed" terminal state.
   */
  extern dec lroFailed(entity: EnumMember | UnionVariant);

  /**
   * Used for custom StatusMonitor implementation.
   * Identifies a model property of a StatusMonitor as containing the result
   * of a long-running operation that terminates successfully (Succeeded).
   */
  extern dec lroResult(entity: ModelProperty);

  /**
   * Used for custom StatusMonitor implementation.
   * Identifies a model property of a StatusMonitor as containing the result
   * of a long-running operation that terminates unsuccessfully (Failed).
   */
  extern dec lroErrorResult(entity: ModelProperty);

  /**
   * Identifies a model property as containing the location to poll for operation state.
   * @param options PollingOptions for the poller pointed to by this link.  Overrides
   * settings derived from property value it is decorating, if the value of the
   * property is ResourceLocation<Resource>
   */
  extern dec pollingLocation(entity: ModelProperty, options?: PollingOptions);

  /**
   * Identifies a ModelProperty as containing the final location for the operation result.
   * @param finalResult Sets the expected return value for the final result.  Overrides
   * any value provided in the decorated property, if the property uses ResourceLocation<Resource>.
   */
  extern dec finalLocation(entity: ModelProperty, finalResult?: Model | unknown | void);

  /**
   * Identifies an operation that is linked to the target operation.
   * @param linkedOperation The linked Operation
   * @param linkType A string indicating the role of the linked operation
   * @param parameters Map of \`RequestParameter<Name>\` and/or \`ResponseProperty<Name>\` that will
   * be passed to the linked operation request.
   */
  extern dec operationLink(
    entity: Operation,
    linkedOperation: Operation,
    linkType: valueof string,
    parameters?: {}
  );

  /**
   * Used to define how to call custom polling operations for long-running operations.
   *
   * @param targetParameter A reference to the polling operation parameter this parameter
   * provides a value for, or the name of that parameter. The default value is the name of
   * the decorated parameter or property.
   */
  extern dec pollingOperationParameter(
    entity: ModelProperty,
    targetParameter?: ModelProperty | string
  );

  /**
   * Identifies that an operation is a polling operation for an LRO.
   * @param linkedOperation The linked Operation
   * @param parameters Map of \`RequestParameter<Name>\` and/or \`ResponseProperty<Name>\` that will
   * be passed to the linked operation request.
   */
  extern dec pollingOperation(entity: Operation, linkedOperation: Operation, parameters?: {});

  /**
   * Identifies that an operation is the final operation for an LRO.
   * @param linkedOperation The linked Operation
   * @param parameters Map of \`RequestParameter<Name>\` and/or \`ResponseProperty<Name>\` that will
   * be passed to the linked operation request.
   */
  extern dec finalOperation(entity: Operation, linkedOperation: Operation, parameters?: {});

  /**
   * Overrides the final state value for an operation
   * @param finalState The desired final state value
   */
  extern dec useFinalStateVia(
    entity: Operation,
    finalState: valueof "original-uri" | "operation-location" | "location" | "azure-async-operation"
  );

  /**
   * Specifies that an array model or array-typed property should contain only unique items.
   */
  extern dec uniqueItems(entity: ModelProperty | Model);
}

namespace Azure.Core.Foundations {
  /**
   * Deletes any key properties from the model.
   */
  extern dec omitKeyProperties(entity: Model);

  /**
   * Identifies a property on a request model that serves as a linked operation parameter.
   * @param name Property name on the target
   */
  extern dec requestParameter(entity: Model, name: valueof string);

  /**
   * Identifies a property on *all* non-error response models that serve as a linked operation parameter.
   * @param name Property name on the target
   */
  extern dec responseProperty(entity: Model, name: valueof string);
}

namespace Azure.Core.Foundations.Private {
  /**
   * Provides a Model describing parameter customizations to spread into the target.
   * @param customizations Model describing the customization to spread
   */
  extern dec spreadCustomParameters(entity: Model, customizations: Model);

  /**
   * Provides a Model describing response property customizations to spread into the target.
   * @param customizations Model describing the customization to spread
   */
  extern dec spreadCustomResponseProperties(entity: Model, customizations: Model);

  /**
   * Checks the Resource parameter of an operation signature to ensure it's a valid resource type.
   * Also marks the operation as a resource operation.
   * @param resourceType The possible resource Type to validate.
   */
  extern dec ensureResourceType(entity: TypeSpec.Reflection.Operation, resourceType: unknown);

  /**
   * Checks the Resource parameter of an operation signature to ensure it's a valid resource type.
   */
  extern dec needsRoute(entity: TypeSpec.Reflection.Operation);

  /**
   * Issues a warning if an operation which derives from an operation templated marked with \`@ensureVerb\`
   * differs from the verb specified.
   * @param templateName: Name of the template operation.
   * @param verb The intended HTTP verb.
   */
  extern dec ensureVerb(
    entity: TypeSpec.Reflection.Operation,
    templateName: valueof string,
    verb: valueof string
  );

  /**
   * Identifies that a model should be treated as an embedding vector.
   */
  extern dec embeddingVector(entity: TypeSpec.Reflection.Model, type: TypeSpec.Reflection.Scalar);

  model ArmResourceIdentifierConfigOptions {
    allowedResources: ArmResourceIdentifierAllowedResource[];
  }

  /** Configuration for the armResourceIdentifier scalar */
  extern dec armResourceIdentifierConfig(
    target: Scalar,
    options: ArmResourceIdentifierConfigOptions
  );

  /**
   * Sets the priority order of default final-state-via options for an operation
   * @param states: list of final-state-via options in priority order
   */
  extern dec defaultFinalStateVia(
    target: TypeSpec.Reflection.Operation,
    states: valueof ("operation-location" | "location" | "azure-async-operation")[]
  );

  /**
   * Internal decorator marking a scalar as a next link that requires parameterization before use.
   *
   * You most likely don't need to use this decorator since next links that require parameterization are against
   * guidelines.
   */
  extern dec parameterizedNextLinkConfig(target: Scalar, parameters: ModelProperty[]);
}
`,"../../../../../../src/typespec/packages/typespec-azure-core/lib/legacy.tsp":`using TypeSpec.Reflection;

namespace Azure.Core.Legacy;

/**
 * A scalar type representing a next link that requires formatting with parameters to be used.
 *
 * @example
 * \`\`\`typespec
 * model ListCertificateOptions {
 *   includePending?: string;
 * }
 * model Certificate {
 *   name: string;
 * }
 * model Page {
 *   @pageItems items: Certificate[];
 *   @nextLink nextLink: Azure.Core.Legacy.parameterizedNextLink<[ListCertificateOptions.includePending]>;
 * }
 * \`\`\`
 */
@Azure.Core.Foundations.Private.parameterizedNextLinkConfig(ParameterizedParams)
scalar parameterizedNextLink<ParameterizedParams extends TypeSpec.Reflection.ModelProperty[]>
  extends url;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/arm.tsp":`import "../dist/src/tsp-index.js";
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";

// Kept for legacy reasons remove when specs are migrated
import "@typespec/openapi";

import "./foundations/arm.foundations.tsp";
import "./legacy-types/arm.legacy.tsp";
import "./common-types/common-types.tsp";
import "./extension/extension.tsp";
import "./backcompat.tsp";
import "./private.decorators.tsp";
import "./models.tsp";
import "./operations.tsp";
import "./decorators.tsp";
import "./interfaces.tsp";
import "./responses.tsp";
import "./parameters.tsp";
import "./private-endpoints.tsp";
import "./private-links.tsp";
import "./network-security-perimeter.tsp";

namespace Azure.ResourceManager;
`,"../../../../../../src/typespec/core/packages/openapi/lib/main.tsp":`import "../dist/src/tsp-index.js";
import "./decorators.tsp";
`,"../../../../../../src/typespec/core/packages/openapi/lib/decorators.tsp":`using TypeSpec.Reflection;

namespace TypeSpec.OpenAPI;

/**
 * Specify the OpenAPI \`operationId\` property for this operation.
 *
 * @param operationId Operation id value.
 *
 * @example
 *
 * \`\`\`typespec
 * @operationId("download")
 * op read(): string;
 * \`\`\`
 */
extern dec operationId(target: Operation, operationId: valueof string);

/**
 * Attach some custom data to the OpenAPI element generated from this type.
 *
 * @param key Extension key.
 * @param value Extension value.
 *
 * @example
 *
 * \`\`\`typespec
 * @extension("x-custom", "My value")
 * @extension("x-pageable", #{nextLink: "x-next-link"})
 * op read(): string;
 * \`\`\`
 */
extern dec extension(target: unknown, key: valueof string, value: valueof unknown);

/**
 * Specify that this model is to be treated as the OpenAPI \`default\` response.
 * This differs from the compiler built-in \`@error\` decorator as this does not necessarily represent an error.
 *
 * @example
 *
 * \`\`\`typespec
 * @defaultResponse
 * model PetStoreResponse is object;
 *
 * op listPets(): Pet[] | PetStoreResponse;
 * \`\`\`
 */
extern dec defaultResponse(target: Model);

/**
 * Specify the OpenAPI \`externalDocs\` property for this type.
 *
 * @param url Url to the docs
 * @param description Description of the docs
 *
 * @example
 * \`\`\`typespec
 * @externalDocs("https://example.com/detailed.md", "Detailed information on how to use this operation")
 * op listPets(): Pet[];
 * \`\`\`
 */
extern dec externalDocs(target: unknown, url: valueof string, description?: valueof string);

/** Additional information for the OpenAPI document. */
model AdditionalInfo {
  /** The title of the API. Overrides the \`@service\` title. */
  title?: string;

  /** A short summary of the API. Overrides the \`@summary\` provided on the service namespace. */
  summary?: string;

  /** The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version). */
  version?: string;

  /** A URL to the Terms of Service for the API. MUST be in the format of a URL. */
  termsOfService?: url;

  /** The contact information for the exposed API. */
  contact?: Contact;

  /** The license information for the exposed API. */
  license?: License;

  ...Record<unknown>;
}

/** Contact information for the exposed API. */
model Contact {
  /** The identifying name of the contact person/organization. */
  name?: string;

  /** The URL pointing to the contact information. MUST be in the format of a URL. */
  url?: url;

  /** The email address of the contact person/organization. MUST be in the format of an email address. */
  email?: string;

  ...Record<unknown>;
}

/** License information for the exposed API. */
model License {
  /** The license name used for the API. */
  name: string;

  /** A URL to the license used for the API. MUST be in the format of a URL. */
  url?: url;

  ...Record<unknown>;
}

/**
 * Specify OpenAPI additional information.
 * The service \`title\` is already specified using \`@service\`.
 * @param additionalInfo Additional information
 */
extern dec info(target: Namespace, additionalInfo: valueof AdditionalInfo);

/** Metadata to a single tag that is used by operations. */
model TagMetadata {
  /** A description of the tag. */
  description?: string;

  /** External documentation information for the tag. */
  externalDocs?: ExternalDocs;

  /** The name of a tag that this tag is nested under. Only supported in OpenAPI 3.2. For 3.0 and 3.1, this will be converted to \`x-parent\`. */
  parent?: string;

  /** A short summary of the tag, used for display purposes. Only supported natively in OpenAPI 3.2. For 3.0 and 3.1, this will be emitted as \`x-oai-summary\`. */
  summary?: string;

  /** A machine-readable string to categorize what sort of tag it is. Any string value can be used. Only supported natively in OpenAPI 3.2. For 3.0 and 3.1, this will be emitted as \`x-oai-kind\`. */
  kind?: string;

  /** Attach some custom data, The extension key must start with \`x-\`. */
  ...Record<unknown>;
}

/** Metadata for a tag that includes the name of the tag. Used with the array form of \`@tagMetadata\`. */
model TagMetadataWithName {
  /** The name of the tag. */
  name: string;

  ...TagMetadata;
}

/** External Docs information. */
model ExternalDocs {
  /** Documentation url */
  url: string;

  /** Optional description */
  description?: string;

  /** Attach some custom data, The extension key must start with \`x-\`. */
  ...Record<unknown>;
}

/**
 * Specify OpenAPI tag metadata. Can be used in two forms:
 * - Inline form: specify a single tag by name with optional metadata.
 * - Array form: specify an ordered list of tags with their metadata in a single decorator call.
 *
 * @param name Tag name (inline form) or array of tags with metadata (array form).
 * @param tagMetadata Additional information for the tag. Only used in inline form.
 *
 * @example Inline form
 * \`\`\`typespec
 * @service()
 * @tagMetadata("Tag Name", #{description: "Tag description", externalDocs: #{url: "https://example.com", description: "More info.", \`x-custom\`: "string"}, \`x-custom\`: "string"})
 * @tagMetadata("Child Tag", #{description: "Child tag description", parent: "Tag Name"})
 * namespace PetStore {}
 * \`\`\`
 *
 * @example Array form (preserves explicit tag order)
 * \`\`\`typespec
 * @service()
 * @tagMetadata(#[
 *   #{ name: "First Tag", description: "First tag description" },
 *   #{ name: "Second Tag", description: "Second tag description" },
 * ])
 * namespace PetStore {}
 * \`\`\`
 */
extern dec tagMetadata(
  target: Namespace,
  name: valueof string | TagMetadataWithName[],
  tagMetadata?: valueof TagMetadata
);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/foundations/arm.foundations.tsp":`import "@typespec/http";
import "@typespec/rest";

import "./backcompat.tsp";
import "./deprecation.tsp";
import "../common-types/common-types.tsp";
import "../decorators.tsp";
import "../responses.tsp";
import "../private.decorators.tsp";
import "../parameters.tsp";

using Http;
using Azure.ResourceManager.Private;

namespace Azure.ResourceManager.Foundations;

/**
 * Base parameters for a resource.
 *
 * @template Resource The type of the resource.
 */
alias BaseParameters<Resource extends {}> = DefaultBaseParameters<Resource>;

/**
 * Base parameters for a resource.
 * @template Resource The type of the resource.
 */
@resourceBaseParametersOf(Resource)
model DefaultBaseParameters<Resource extends {}> {
  ...CommonTypes.ApiVersionParameter;

  // unless tenant or extension
  ...CommonTypes.SubscriptionIdParameter;

  // deprecated, should not be used
  ...CommonTypes.LocationParameter;

  // unless tenant, subscription, location, or extension
  ...CommonTypes.ResourceGroupNameParameter;

  // unless tenant, subscription, location, or resourceGroup
  ...ResourceUriParameter;
}

/**
 * Standard type definition for Azure Resource Manager Tags property.
 *
 * It is included in the TrackedResource template definition.
 */
/** The Azure Resource Manager Resource tags. */
model ArmTagsProperty {
  /** Resource tags. */
  tags?: Record<string>;
}

/**
 * The static parameters for a tenant-based resource
 */
model TenantBaseParameters {
  ...CommonTypes.ApiVersionParameter;
}

/**
 * The static parameters for a subscription based resource
 */
model SubscriptionBaseParameters is TenantBaseParameters {
  ...CommonTypes.SubscriptionIdParameter;
}

/**
 * The static parameters for a location-based resource
 */
model LocationBaseParameters is SubscriptionBaseParameters {
  ...LocationParameter;
}

/**
 * The static parameters for a resource-group based resource
 */
model ResourceGroupBaseParameters is SubscriptionBaseParameters {
  ...CommonTypes.ResourceGroupNameParameter;
}

/**
 * The static parameters for an extension resource
 */
model ExtensionBaseParameters is TenantBaseParameters {
  ...ResourceUriParameter;
}

/**
 * Defines a properties type used to create named resource update models.
 * This type is not used directly, it is referenced by ResourceUpdateModel.
 * @template Resource The type of the resource.
 * @template Properties The type of the properties.
 */
@doc("The updatable properties of the {name}.", Resource)
@friendlyName("{name}UpdateProperties", Resource)
model ResourceUpdateModelProperties<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
> is OptionalProperties<UpdateableProperties<Properties>>;

/**
 * Defines a model type used to create named resource update models
 * e.g. \`model MyResourceUpdate is ResourceUpdate<MyResourceProperties> {}\`
 * @template Resource The type of the resource.
 * @template Properties The type of the properties.
 */
@doc("The type used for update operations of the {name}.", Resource)
@friendlyName("{name}Update", Resource)
@omitIfEmpty("properties")
model ResourceUpdateModel<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
>
  is OptionalProperties<UpdateableProperties<OmitProperties<
    Resource,
    "Name" | "name" | "properties"
  >>> {
  /** The resource-specific properties for this resource. */
  properties?: ResourceUpdateModelProperties<Resource, Properties>;
}

/**
 * The type used for updating tags in resources.
 * @template Resource The type of the resource.
 */
@doc("The type used for updating tags in {name} resources.", Resource)
@friendlyName("{name}TagsUpdate", Resource)
model TagsUpdateModel<Resource extends Foundations.SimpleResource> {
  ...ArmTagsProperty;
}

// Tenant resource operation definitions

alias TenantParentScope<Resource extends Foundations.SimpleResource> = TenantScope<Resource>;

/**
 * Parameter model for listing a resource at the tenant scope
 * @template Resource The type of the resource.
 */
model TenantScope<Resource extends Foundations.SimpleResource>
  is ResourceParentParameters<Resource, TenantBaseParameters>;

/**
 * Parameter model for listing a resource at the subscription scope
 * @template Resource The type of the resource.
 */
model SubscriptionScope<Resource extends Foundations.SimpleResource>
  is ResourceParentParameters<Resource, SubscriptionBaseParameters>;

/**
 * Parameter model for listing a resource at the location scope
 * @template Resource The type of the resource.
 */
model LocationScope<Resource extends Foundations.SimpleResource>
  is ResourceParentParameters<Resource, LocationBaseParameters>;

/**
 * Parameter model for listing an extension resource
 * @template Resource The type of the resource.
 */
model ExtensionScope<Resource extends Foundations.SimpleResource>
  is ResourceParentParameters<Resource, ExtensionBaseParameters>;

/**
 * Parameter model for listing a resource at the resource group scope
 * @template Resource The type of the resource.
 */
model ResourceGroupScope<Resource extends Foundations.SimpleResource>
  is ResourceParentParameters<Resource>;

/**
 * The type used for update operations of the resource.
 * @template Resource The type of the resource.
 * @template Properties The type of the properties.
 */
@doc("The type used for update operations of the {name}.", Resource)
@friendlyName("{name}Update", Resource)
model ProxyResourceUpdateModel<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
> {
  properties?: ResourceUpdateModelProperties<Resource, Properties>;
}

/** A base definition of a resource using simple types.  This
 * model should only be used as a constraint for other models.
 */
model SimpleResource {
  /** The resource identifier */
  id?: string;

  /** The resource name */
  name?: string;

  /** The resource type */
  type?: string;

  /** readonly data about the resource */
  systemData?: unknown;
}

alias DefaultProviderNamespace = {
  @path
  @TypeSpec.Rest.segment("providers")
  @doc("The provider namespace for the resource.")
  provider: "Microsoft.ThisWillBeReplaced";
};

/**
 * Adds check name availability operation, normally used if
 * a resource name must be globally unique (for example, if the resource
 * exposes an endpoint that uses the resource name in the url)
 * @template ScopeParameters A parameter model with properties representing the scope of the resource
 * @template Request The operation request body
 * @template Response The operation response
 * @template AdditionalParams A parameter model with properties representing non-path parameters
 */
@TypeSpec.Rest.autoRoute
@armResourceCollectionAction
@armProviderNameValue
@doc("Implements global CheckNameAvailability operations")
@TypeSpec.Rest.action("checkNameAvailability")
@post
op checkNameAvailability<
  ScopeParameters extends TypeSpec.Reflection.Model,
  Request extends TypeSpec.Reflection.Model = Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest,
  Response extends TypeSpec.Reflection.Model = CheckNameAvailabilityResponse,
  AdditionalParams extends TypeSpec.Reflection.Model = {}
>(
  ...CommonTypes.ApiVersionParameter,
  ...ScopeParameters,
  ...AdditionalParams,

  @doc("The CheckAvailability request")
  @body
  body: Request,
): Response | ErrorResponse;

/**
 * @dev The base template for Azure Resource Manager GET and HEAD Operations.
 * @template Parameters The parameter object for the operation.
 * @template Response The response or union of responses for success.
 * @template ErrorResponse The error response.
 */
op ArmReadOperation<Parameters extends {}, Response extends {}, ErrorResponse extends {}>(
  ...Parameters,
): Response | ErrorResponse;

/**
 * @dev The base template for Azure Resource Manager PUT Operations.
 * @template HttpParameters The parameter object for the operation.
 * @template BodyParameter The body parameter
 * @template Response The response or union of responses for success.
 * @template ErrorResponse The error response.
 */
op ArmCreateOperation<
  HttpParameters extends {},
  BodyParameter extends {},
  Response extends {},
  ErrorResponse extends {}
>(...HttpParameters, @doc("Resource create parameters.") @bodyRoot resource: BodyParameter):
  | Response
  | ErrorResponse;

/**
 * @dev The base template for Azure Resource Manager PATCH Operations.
 * @template HttpParameters The parameter object for the operation.
 * @template BodyParameter The body parameter
 * @template Response The response or union of responses for success.
 * @template ErrorResponse The error response.
 */
op ArmUpdateOperation<
  HttpParameters extends {},
  BodyParameter extends {},
  Response extends {},
  ErrorResponse extends {}
>(
  ...HttpParameters,
  @doc("The resource properties to be updated.") @bodyRoot properties: BodyParameter,
): Response | ErrorResponse;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/foundations/backcompat.tsp":`namespace Azure.ResourceManager.Foundations {
  // extended-location
  alias ExtendedLocation = CommonTypes.ExtendedLocation;
  alias ExtendedLocationType = CommonTypes.ExtendedLocationType;

  // managed-identities
  alias ManagedServiceIdentity = CommonTypes.ManagedServiceIdentity;
  #suppress "deprecated" "Need for back compatibility in common-types"
  alias UserAssignedIdentities = CommonTypes.UserAssignedIdentities;
  alias SystemAssignedServiceIdentity = CommonTypes.SystemAssignedServiceIdentity;
  alias UserAssignedIdentity = CommonTypes.UserAssignedIdentity;
  alias ManagedServiceIdentityType = CommonTypes.ManagedServiceIdentityType;
  alias SystemAssignedServiceIdentityType = CommonTypes.SystemAssignedServiceIdentityType;
  alias ManagedSystemIdentityType = SystemAssignedServiceIdentityType;

  // types
  alias Resource = CommonTypes.Resource;
  alias AzureEntityResource = CommonTypes.AzureEntityResource;
  alias TrackedResource = CommonTypes.TrackedResource;
  alias ProxyResource = CommonTypes.ProxyResource;
  alias ExtensionResource = CommonTypes.ExtensionResource;
  alias Sku = CommonTypes.Sku;
  alias SkuTier = CommonTypes.SkuTier;
  alias OperationListResult = CommonTypes.OperationListResult;
  alias Operation = CommonTypes.Operation;
  alias OperationDisplay = CommonTypes.OperationDisplay;
  alias OperationStatusResult = CommonTypes.OperationStatusResult;
  alias OperationIdParameter = CommonTypes.OperationIdParameter;
  alias ActionType = CommonTypes.ActionType;
  alias Origin = CommonTypes.Origin;
  alias ErrorDetail = CommonTypes.ErrorDetail;
  alias ErrorAdditionalInfo = CommonTypes.ErrorAdditionalInfo;
  alias SystemData = CommonTypes.SystemData;
  alias createdByType = CommonTypes.createdByType;
  alias Plan = CommonTypes.Plan;
  alias CheckNameAvailabilityRequest = CommonTypes.CheckNameAvailabilityRequest;
  alias CheckNameAvailabilityResponse = CommonTypes.CheckNameAvailabilityResponse;
  alias CheckNameAvailabilityReason = CommonTypes.CheckNameAvailabilityReason;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/foundations/deprecation.tsp":`namespace Azure.ResourceManager.Foundations;

#deprecated "Please use Foundations.Resource instead of Foundations.ArmResource"
alias ArmResource = Resource;

#deprecated "Please use Foundations.TrackedResource instead of Foundations.TrackedResourceBase"
alias TrackedResourceBase = TrackedResource;

#deprecated "Please use Foundations.ProxyResource instead of Foundations.ProxyResourceBase"
alias ProxyResourceBase = ProxyResource;

#deprecated "Please use Foundations.ExtensionResource instead of Foundations.ExtensionResourceBase"
alias ExtensionResourceBase = ExtensionResource;

#deprecated "Please use Foundations.Sku instead of Foundations.ResourceSkuType"
alias ResourceSkuType = Sku;

#deprecated "Please use Foundations.Plan instead of Foundations.ResourcePlanType"
alias ResourcePlanType = Plan;

// managed-identity
#deprecated "Please change ManagedIdentityProperties to ManagedServiceIdentity."
alias ManagedIdentityProperties = ManagedServiceIdentity;

#deprecated "Please change ManagedSystemIdentityProperties to SystemAssignedServiceIdentity."
alias ManagedSystemIdentityProperties = SystemAssignedServiceIdentity;

/** Alias of ManagedServiceIdentityType for back compatibility. Please change to ManagedServiceIdentityType. */
#deprecated "Please change to ManagedServiceIdentityType."
alias ManagedIdentityType = ManagedServiceIdentityType;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/common-types.tsp":`import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "./types-ref.tsp";
import "./managed-identity-ref.tsp";
import "./managed-identity-with-delegation-ref.tsp";
import "./private-links-ref.tsp";
import "./customer-managed-keys-ref.tsp";
import "./extended-location-ref.tsp";
import "./internal.tsp";
import "./commontypes.private.decorators.tsp";
import "./versions.tsp";
import "./mobo-ref.tsp";
import "./network-security-perimeter-ref.tsp";
import "./nsp-operations.tsp";

namespace Azure.ResourceManager.CommonTypes;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/types-ref.tsp":`import "../private.decorators.tsp";
import "./common-types.tsp";
import "./types.tsp";

using Azure.ResourceManager.Private;
using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager.CommonTypes;

@@azureResourceBase(Resource);
@@azureResourceBase(ResourceModelWithAllowedPropertySet);

/** Common resource fields that are returned in the response for all Azure Resource Manager resources. */
@@armCommonDefinition(Resource, "Resource", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(Resource, "Resource", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(Resource, "Resource", Azure.ResourceManager.CommonTypes.Versions.v5);
@@armCommonDefinition(Resource, "Resource", Azure.ResourceManager.CommonTypes.Versions.v6);

/** The resource model definition for an Azure Resource Manager resource with an etag. */
@@armCommonDefinition(
  AzureEntityResource,
  "AzureEntityResource",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  AzureEntityResource,
  "AzureEntityResource",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  AzureEntityResource,
  "AzureEntityResource",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  AzureEntityResource,
  "AzureEntityResource",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * The base tracked resource.
 */
@@armCommonDefinition(
  TrackedResource,
  "TrackedResource",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  TrackedResource,
  "TrackedResource",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  TrackedResource,
  "TrackedResource",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  TrackedResource,
  "TrackedResource",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * The base proxy resource.
 */
@@armCommonDefinition(
  ProxyResource,
  "ProxyResource",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  ProxyResource,
  "ProxyResource",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  ProxyResource,
  "ProxyResource",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  ProxyResource,
  "ProxyResource",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * The base extension resource.
 */
@@armCommonDefinition(
  ExtensionResource,
  "ProxyResource",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  ExtensionResource,
  "ProxyResource",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  ExtensionResource,
  "ProxyResource",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  ExtensionResource,
  "ProxyResource",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * The SKU (Stock Keeping Unit) assigned to this resource.
 */
@@armCommonDefinition(Sku, "Sku", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(Sku, "Sku", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(Sku, "Sku", Azure.ResourceManager.CommonTypes.Versions.v5);
@@armCommonDefinition(Sku, "Sku", Azure.ResourceManager.CommonTypes.Versions.v6);

/**
 * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
 */
@@armCommonDefinition(
  OperationListResult,
  "OperationListResult",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  OperationListResult,
  "OperationListResult",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  OperationListResult,
  "OperationListResult",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  OperationListResult,
  "OperationListResult",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * Details of a REST API operation, returned from the Resource Provider Operations API
 */
@@armCommonDefinition(Operation, "Operation", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(Operation, "Operation", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(Operation, "Operation", Azure.ResourceManager.CommonTypes.Versions.v5);
@@armCommonDefinition(Operation, "Operation", Azure.ResourceManager.CommonTypes.Versions.v6);

/**
 * Localized display information for an operation.
 */
@@armCommonDefinition(
  OperationDisplay,
  "OperationDisplay",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  OperationDisplay,
  "OperationDisplay",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  OperationDisplay,
  "OperationDisplay",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  OperationDisplay,
  "OperationDisplay",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * The current status of an async operation.
 */
@@armCommonDefinition(
  OperationStatusResult,
  "OperationStatusResult",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  OperationStatusResult,
  "OperationStatusResult",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  OperationStatusResult,
  "OperationStatusResult",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  OperationStatusResult,
  "OperationStatusResult",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * locationData
 */
@@armCommonDefinition(LocationData, "locationData", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(LocationData, "locationData", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(LocationData, "locationData", Azure.ResourceManager.CommonTypes.Versions.v5);
@@armCommonDefinition(LocationData, "locationData", Azure.ResourceManager.CommonTypes.Versions.v6);

/**
 * The error detail.
 */
@@armCommonDefinition(ErrorDetail, "ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(ErrorDetail, "ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(ErrorDetail, "ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v5);
@@armCommonDefinition(ErrorDetail, "ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v6);

/**
 * The resource management error additional info.
 */
@@armCommonDefinition(
  ErrorAdditionalInfo,
  "ErrorAdditionalInfo",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  ErrorAdditionalInfo,
  "ErrorAdditionalInfo",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  ErrorAdditionalInfo,
  "ErrorAdditionalInfo",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  ErrorAdditionalInfo,
  "ErrorAdditionalInfo",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * Identity
 */
@@armCommonDefinition(Identity, "Identity", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(Identity, "Identity", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(Identity, "Identity", Azure.ResourceManager.CommonTypes.Versions.v5);

/**
 * Metadata pertaining to creation and last modification of the resource.
 */
@@armCommonDefinition(SystemData, "systemData", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(SystemData, "systemData", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(SystemData, "systemData", Azure.ResourceManager.CommonTypes.Versions.v5);
@@armCommonDefinition(SystemData, "systemData", Azure.ResourceManager.CommonTypes.Versions.v6);

/**
 * Details of the resource plan.
 */
@@armCommonDefinition(Plan, "Plan", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(Plan, "Plan", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(Plan, "Plan", Azure.ResourceManager.CommonTypes.Versions.v5);
@@armCommonDefinition(Plan, "Plan", Azure.ResourceManager.CommonTypes.Versions.v6);

/**
 * encryptionProperties
 */
@@armCommonDefinition(
  EncryptionProperties,
  "encryptionProperties",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  EncryptionProperties,
  "encryptionProperties",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  EncryptionProperties,
  "encryptionProperties",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  EncryptionProperties,
  "encryptionProperties",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * KeyVaultProperties
 */
@@armCommonDefinition(
  KeyVaultProperties,
  "KeyVaultProperties",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  KeyVaultProperties,
  "KeyVaultProperties",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  KeyVaultProperties,
  "KeyVaultProperties",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  KeyVaultProperties,
  "KeyVaultProperties",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * ResourceModelWithAllowedPropertySet
 */
@@armCommonDefinition(
  ResourceModelWithAllowedPropertySet,
  "ResourceModelWithAllowedPropertySet",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  ResourceModelWithAllowedPropertySet,
  "ResourceModelWithAllowedPropertySet",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  ResourceModelWithAllowedPropertySet,
  "ResourceModelWithAllowedPropertySet",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  ResourceModelWithAllowedPropertySet,
  "ResourceModelWithAllowedPropertySet",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * The check availability request body.
 */
@@armCommonDefinition(
  CheckNameAvailabilityRequest,
  "CheckNameAvailabilityRequest",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  CheckNameAvailabilityRequest,
  "CheckNameAvailabilityRequest",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  CheckNameAvailabilityRequest,
  "CheckNameAvailabilityRequest",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  CheckNameAvailabilityRequest,
  "CheckNameAvailabilityRequest",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * The check availability result.
 */
@@armCommonDefinition(
  CheckNameAvailabilityResponse,
  "CheckNameAvailabilityResponse",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  CheckNameAvailabilityResponse,
  "CheckNameAvailabilityResponse",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  CheckNameAvailabilityResponse,
  "CheckNameAvailabilityResponse",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  CheckNameAvailabilityResponse,
  "CheckNameAvailabilityResponse",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

@@armCommonDefinition(
  ErrorResponse,
  "ErrorResponse",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonDefinition(
  ErrorResponse,
  "ErrorResponse",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  ErrorResponse,
  "ErrorResponse",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  ErrorResponse,
  "ErrorResponse",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

@@armCommonDefinition(SkuTier, "SkuTier", Azure.ResourceManager.CommonTypes.Versions.v3);
@@armCommonDefinition(SkuTier, "SkuTier", Azure.ResourceManager.CommonTypes.Versions.v4);
@@armCommonDefinition(SkuTier, "SkuTier", Azure.ResourceManager.CommonTypes.Versions.v5);
@@armCommonDefinition(SkuTier, "SkuTier", Azure.ResourceManager.CommonTypes.Versions.v6);

// -- Parameters
/** ApiVersionParameter */
@@armCommonParameter(
  ApiVersionParameter.apiVersion,
  "ApiVersionParameter",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonParameter(
  ApiVersionParameter.apiVersion,
  "ApiVersionParameter",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonParameter(
  ApiVersionParameter.apiVersion,
  "ApiVersionParameter",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonParameter(
  ApiVersionParameter.apiVersion,
  "ApiVersionParameter",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

@@resourceParameterBaseFor(
  ApiVersionParameter.apiVersion,
  [
    ResourceHome.ResourceGroup,
    ResourceHome.Subscription,
    ResourceHome.Location,
    ResourceHome.Tenant,
    ResourceHome.Extension,
    ResourceHome.BuiltIn,
    ResourceHome.BuiltInSubscription,
    ResourceHome.BuiltInResourceGroup
  ]
);

/** SubscriptionIdParameter */
@@armCommonParameter(
  SubscriptionIdParameter.subscriptionId,
  "SubscriptionIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonParameter(
  SubscriptionIdParameter.subscriptionId,
  "SubscriptionIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonParameter(
  SubscriptionIdParameter.subscriptionId,
  "SubscriptionIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonParameter(
  SubscriptionIdParameter.subscriptionId,
  "SubscriptionIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v6
);
@@resourceParameterBaseFor(
  SubscriptionIdParameter.subscriptionId,
  [
    ResourceHome.ResourceGroup,
    ResourceHome.Subscription,
    ResourceHome.Location,
    ResourceHome.BuiltInSubscription,
    ResourceHome.BuiltInResourceGroup
  ]
);

/** ResourceGroupNameParameter */
@@armCommonParameter(
  ResourceGroupNameParameter.resourceGroupName,
  "ResourceGroupNameParameter",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonParameter(
  ResourceGroupNameParameter.resourceGroupName,
  "ResourceGroupNameParameter",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonParameter(
  ResourceGroupNameParameter.resourceGroupName,
  "ResourceGroupNameParameter",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonParameter(
  ResourceGroupNameParameter.resourceGroupName,
  "ResourceGroupNameParameter",
  Azure.ResourceManager.CommonTypes.Versions.v6
);
@@resourceParameterBaseFor(
  ResourceGroupNameParameter.resourceGroupName,
  [ResourceHome.ResourceGroup, ResourceHome.BuiltInResourceGroup]
);

/** ManagementGroupNameParameter */
@@armCommonParameter(
  ManagementGroupNameParameter.managementGroupName,
  "ManagementGroupNameParameter",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonParameter(
  ManagementGroupNameParameter.managementGroupName,
  "ManagementGroupNameParameter",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonParameter(
  ManagementGroupNameParameter.managementGroupName,
  "ManagementGroupNameParameter",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonParameter(
  ManagementGroupNameParameter.managementGroupName,
  "ManagementGroupNameParameter",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/** ScopeParameter */
@@armCommonParameter(
  ScopeParameter.scope,
  "ScopeParameter",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonParameter(
  ScopeParameter.scope,
  "ScopeParameter",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonParameter(
  ScopeParameter.scope,
  "ScopeParameter",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonParameter(
  ScopeParameter.scope,
  "ScopeParameter",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/** LocationResourceParameter */
@@armCommonParameter(
  LocationResourceParameter.location,
  "LocationParameter",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonParameter(
  LocationResourceParameter.location,
  "LocationParameter",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonParameter(
  LocationResourceParameter.location,
  "LocationParameter",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonParameter(
  LocationResourceParameter.location,
  "LocationParameter",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * The default operationId parameter type.
 */
@@armCommonParameter(
  OperationIdParameter.operationId,
  "OperationIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonParameter(
  OperationIdParameter.operationId,
  "OperationIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonParameter(
  OperationIdParameter.operationId,
  "OperationIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonParameter(
  OperationIdParameter.operationId,
  "OperationIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/**
 * TenantIdParameter
 */
@@armCommonParameter(
  TenantIdParameter.tenantId,
  "TenantIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v3
);
@@armCommonParameter(
  TenantIdParameter.tenantId,
  "TenantIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonParameter(
  TenantIdParameter.tenantId,
  "TenantIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonParameter(
  TenantIdParameter.tenantId,
  "TenantIdParameter",
  Azure.ResourceManager.CommonTypes.Versions.v6
);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/private.decorators.tsp":`import "../dist/src/private.decorators.js";

namespace Azure.ResourceManager.Private;

using Reflection;

/**
 * Update the Azure Resource Manager provider namespace for a given entity.
 */
extern dec armUpdateProviderNamespace(target: Reflection.Operation);

/**
 * @param resource Resource model
 */
extern dec assignProviderNameValue(target: ModelProperty, resource: Model);

/**
 * @param resource Resource model
 */
extern dec assignUniqueProviderNameValue(target: ModelProperty, resource: Model);

/**
 * This decorator is used to identify Azure Resource Manager resource types and extract their
 * metadata.  It is *not* meant to be used directly by a spec author, it instead
 * gets implicitly applied when the spec author defines a model type in this form:
 *
 *   \`model Server is TrackedResource<ServerProperties>;\`
 *
 * The \`TrackedResource<Resource>\` type (and other associated base types) use the
 * \`@armResource\` decorator, so it also gets applied to the type which absorbs the
 * \`TrackedResource<Resource>\` definition by using the \`is\` keyword.
 *
 * @param properties Azure Resource Manager resource properties
 */
extern dec armResourceInternal(target: Model, properties: Model);

/**
 * This decorator identifies Azure Resource Manager resource types that do not define
 * the name identifier parameter and type
 * @param target Azure Resource Manager resource type
 * @param properties Azure Resource Manager resource properties
 * @param type The resource type name, e.g. "virtualMachines"
 * @param nameParameter The name of the resource name parameter, e.g. "virtualMachineName"
 */
extern dec armResourceWithParameter(
  target: Model,
  properties: Model,
  type: valueof string,
  nameParameter: valueof string
);

/**
 * Omit a property in the target model.
 * @internal
 * @param propertyName Name of the property to omit
 */
extern dec omitIfEmpty(target: Model, propertyName: valueof string);

/**
 * @param propertyName Name of the property to omit
 */
extern dec resourceBaseParametersOf(target: Model, propertyName: Model);
/**
 * @param values Values
 */
extern dec resourceParameterBaseFor(target: ModelProperty, values: unknown[]);

/**
 * Provides default name decoration on resource name property with
 * camelcased and pluralized key and segment name
 */
extern dec defaultResourceKeySegmentName(
  target: ModelProperty,
  armResource: Model,
  keyName: valueof string,
  segment: valueof string
);

/**
 * Provides strict contraint type check.
 *
 * Due to TypeSpec language and all optional properties of \`Foundations.Resource\`,
 * the \`Resource extends Foundations.SimpleResource\` on many of the standard ARM templates is
 * essentially equal to \`Resource extends {}\` and does not enforce the containt.
 *
 * Note, this is intended for internal use only for now.
 */
extern dec enforceConstraint(target: Operation | Model, sourceType: Model, constraintType: Model);

/**
 * This decorator is used to identify Azure Resource Manager resource. In generated
 * swagger definition, it will be marked with \`x-ms-azure-resource\`.
 *
 * It is *not* meant to be used directly by a spec author,
 */
extern dec azureResourceBase(target: Model);

/**
 * Marks the operation as being a collection action
 * @param resourceType Resource
 * @param parentTypeName: Parent type name.
 * @param parentFriendlyTypeName Friendly name for parent.
 * @param applyOperationRename If true, apply both doc and operation name update
 */
extern dec armRenameListByOperation(
  target: Operation,
  resourceType: Model,
  parentTypeName?: valueof string,
  parentFriendlyTypeName?: valueof string,
  applyOperationRename?: valueof boolean
);

/**
 * Please DO NOT USE in RestAPI specs.
 * This decorator is used to adjust optionality on ARM Resource's \`properties\` field for brownfield service conversion.
 */
extern dec armResourcePropertiesOptionality(target: ModelProperty, isOptional: valueof boolean);

/** designates a parameter as an explicit bodyRoot and sets the optionality of the parameter */
extern dec armBodyRoot(target: ModelProperty, isOptional: valueof boolean);

/** designates a type as a legacy type and emits a warning diagnostic when used */
extern dec legacyType(target: Model | Operation | Interface | Scalar);

/** Determines the built-in parent of a base resource
 * @param parentType The parent type of the resource (Subscription, ResourceGroup, Tenant, Extension)
 */
extern dec resourceParentType(
  target: Model,
  parentType: valueof "Subscription" | "ResourceGroup" | "Tenant" | "Extension"
);

/**
 * Marks a resource operation with the associated resource, operation type, and name. If no name is provided, the name is calculated by resource type.
 * @param target The operation to associate the resourceType with
 * @param resourceType The resource model
 * @param operationType The type of operation being performed
 * @param resourceName Optional. The name of the resource. If not provided, the resource type will be used
 */
extern dec legacyResourceOperation(
  target: Operation,
  resourceType: Model,
  operationType: valueof
    | "read"
    | "createOrUpdate"
    | "update"
    | "delete"
    | "list"
    | "action"
    | "checkExistence",
  resourceName?: valueof string
);

/**
 * Marks an extension resource operation with the associated resource, operation type, and name. If no name is provided, the name is calculated by resource type.
 * @param target The operation to associate the resourceType with
 * @param targetResourceType The resource model for the target resource
 * @param extensionResourceType The resource model for the extension resource
 * @param operationType The type of operation being performed
 * @param resourceName Optional. The name of the resource. If not provided, the scope and resource name will be used
 */
extern dec extensionResourceOperation(
  target: Operation,
  targetResourceType: Model,
  extensionResourceType: Model,
  operationType: valueof
    | "read"
    | "createOrUpdate"
    | "update"
    | "delete"
    | "list"
    | "action"
    | "checkExistence",
  resourceName?: valueof string
);

/**
 * Marks an extension resource operation with the associated resource, operation type, and name. If no name is provided, the name is calculated by resource type.
 * @param target The operation to associate the resourceType with
 * @param targetResourceType The resource model for the target resource
 * @param extensionResourceType The resource model for the extension resource
 * @param operationType The type of operation being performed
 * @param resourceName Optional. The name of the resource. If not provided, the scope and resource name will be used
 */
extern dec builtInResourceOperation(
  target: Operation,
  parentResourceType: Model,
  builtInResourceType: Model,
  operationType: valueof
    | "read"
    | "createOrUpdate"
    | "update"
    | "delete"
    | "list"
    | "action"
    | "checkExistence",
  resourceName?: valueof string
);

/**
 * Marks a resource operation with the associated resource, operation type, and name. If no name is provided, the name is calculated by resource type.
 * @param target The operation to associate the resourceType with
 * @param resourceType The resource model
 * @param operationType The type of operation being performed
 * @param resourceName Optional. The name of the resource. If not provided, the resource type will be used
 */
extern dec legacyExtensionResourceOperation(
  target: Operation,
  resourceType: Model,
  operationType: valueof
    | "read"
    | "createOrUpdate"
    | "update"
    | "delete"
    | "list"
    | "action"
    | "checkExistence",
  resourceName?: valueof string
);

/**
 * Validates that the specified common-types version is valid for the given resource type.
 * @param target The resource model
 * @param version The common-types version
 * @param resourceName The name of the resource
 */
extern dec validateCommonTypesVersionForResource(
  target: Model,
  version: valueof string,
  resourceName: valueof string
);

/**
 * This decorator is used to identify a generic Azure Resource Manager resource type
 * that does not require name, key, or segment properties on the model itself.
 * The resource type and path information comes from the operations (e.g. RoutedOperations).
 *
 * It is *not* meant to be used directly by a spec author, it instead
 * gets implicitly applied when the spec author defines a model type in this form:
 *
 *   \`model MyResource is GenericResource;\`
 */
extern dec genericResourceInternal(target: Model);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/types.tsp":`using Http;
using Rest;
using Versioning;
using Azure.Core;

namespace Azure.ResourceManager.CommonTypes;

/** Common fields that are returned in the response for all Azure Resource Manager resources */
@summary("Resource")
model Resource {
  /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */
  @typeChangedFrom(Versions.v4, string)
  @visibility(Lifecycle.Read)
  id?: armResourceIdentifier;

  /** The name of the resource */
  @visibility(Lifecycle.Read)
  name?: string;

  /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */
  @visibility(Lifecycle.Read)
  type?: armResourceType;

  /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */
  @visibility(Lifecycle.Read)
  systemData?: SystemData;
}

/** The resource model definition for an Azure Resource Manager resource with an etag. */
@summary("Entity Resource")
model AzureEntityResource extends Resource {
  /** Resource Etag. */
  @visibility(Lifecycle.Read)
  etag?: string;
}

/**
 * The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'
 */
@summary("Tracked Resource")
model TrackedResource extends Resource {
  /** Resource tags. */
  tags?: Record<string>;

  /** The geo-location where the resource lives */
  @visibility(Lifecycle.Read, Lifecycle.Create)
  @Azure.ResourceManager.CommonTypes.Private.inlineAzureType
  location: Azure.Core.azureLocation;
}

/**
 * The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location
 */
@summary("Proxy Resource")
model ProxyResource extends Resource {}

/**
 * The base extension resource.
 */
// Note that ProxyResource is the base definition for both kinds of resources
model ExtensionResource extends Resource {}

/**
 * The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set.
 */
model ResourceModelWithAllowedPropertySet extends TrackedResource {
  /** The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource.
   * If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. */
  managedBy?: string;

  /** Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.
   * If supported, the resource provider must validate and persist this value. */
  @pattern("^[-\\\\w\\\\._,\\\\(\\\\)]+$")
  @visibility(Lifecycle.Read, Lifecycle.Create)
  kind?: string;

  /** The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention.
   * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19),
   * If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. */
  @visibility(Lifecycle.Read)
  etag?: string;

  @typeChangedFrom(Versions.v6, Identity)
  identity?: ManagedServiceIdentity;

  sku?: Sku;
  plan?: Plan;
}

/**
 * The resource model definition representing SKU
 */
model Sku {
  /** The name of the SKU. Ex - P3. It is typically a letter+number code */
  name: string;

  /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */
  tier?: SkuTier;

  /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */
  size?: string;

  /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */
  family?: string;

  /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */
  capacity?: int32;
}

/**
 * This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.
 */
union SkuTier {
  /** The Free service tier. */
  Free: "Free",

  /** The Basic service tier. */
  Basic: "Basic",

  /** The Standard service tier. */
  Standard: "Standard",

  /** The Premium service tier. */
  Premium: "Premium",
}

/**
 * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
 */
@friendlyName("OperationListResult")
model OperationListResult is Azure.Core.Page<Operation>;

/**
 * Details of a REST API operation, returned from the Resource Provider Operations API
 */
@summary("REST API Operation")
model Operation {
  /** 
    The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
     */
  @visibility(Lifecycle.Read)
  name?: string;

  /** 
    Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations.
     */
  @visibility(Lifecycle.Read)
  isDataAction?: boolean;

  /** Localized display information for this particular operation. */
  display?: OperationDisplay;

  /** 
    The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
     */
  @visibility(Lifecycle.Read)
  origin?: Origin;

  /** 
    Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
     */
  @visibility(Lifecycle.Read)
  actionType?: ActionType;
}

/**
 * Localized display information for an operation.
 */
model OperationDisplay {
  /** 
  The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
   */
  @visibility(Lifecycle.Read)
  provider?: string;

  /** 
    The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections".
     */
  @visibility(Lifecycle.Read)
  resource?: string;

  /** 
    The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
     */
  @visibility(Lifecycle.Read)
  operation?: string;

  /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */
  @visibility(Lifecycle.Read)
  description?: string;
}

/**
 * The current status of an async operation.
 */
model OperationStatusResult {
  /** Fully qualified ID for the async operation. */
  @typeChangedFrom(Versions.v5, string)
  id?: armResourceIdentifier;

  /** Name of the async operation. */
  name?: string;

  /** Operation status. */
  status: string;

  /** Percent of the operation that is complete. */
  @minValue(0)
  @maxValue(100)
  percentComplete?: float64;

  /** The start time of the operation. */
  startTime?: utcDateTime;

  /** The end time of the operation. */
  endTime?: utcDateTime;

  /** The operations list. */
  operations?: OperationStatusResult[];

  /** If present, details of the operation error. */
  error?: ErrorDetail;

  /** Fully qualified ID of the resource against which the original async operation was started. */
  @visibility(Lifecycle.Read)
  @added(Versions.v5)
  resourceId?: armResourceIdentifier;
}

/**
 * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
 */
union ActionType {
  /** Actions are for internal-only APIs. */
  Internal: "Internal",

  string,
}

/**
 * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
 */
union Origin {
  /** Indicates the operation is initiated by a user. */
  user: "user",

  /** Indicates the operation is initiated by a system. */
  system: "system",

  /** Indicates the operation is initiated by a user or system. */
  \`user,system\`: "user,system",

  string,
}

/**
 * The error detail.
 */
model ErrorDetail {
  /** The error code. */
  @visibility(Lifecycle.Read)
  code?: string;

  /** The error message. */
  @visibility(Lifecycle.Read)
  message?: string;

  /** The error target. */
  @visibility(Lifecycle.Read)
  target?: string;

  /** The error details. */
  @visibility(Lifecycle.Read)
  details?: ErrorDetail[];

  /** The error additional info. */
  @visibility(Lifecycle.Read)
  additionalInfo?: ErrorAdditionalInfo[];
}

/**
 * Common error response for all Azure Resource Manager APIs to return error details for failed operations.
 */
@summary("Error response")
@error
model ErrorResponse {
  /** The error object. */
  error?: ErrorDetail;
}

/**
 * The resource management error additional info.
 */
model ErrorAdditionalInfo {
  /** The additional info type. */
  @visibility(Lifecycle.Read)
  type?: string;

  /** The additional info. */
  @visibility(Lifecycle.Read)
  info?: unknown;
}

/**
 * Metadata pertaining to creation and last modification of the resource.
 */
model SystemData {
  /** The identity that created the resource. */
  createdBy?: string;

  /** The type of identity that created the resource. */
  createdByType?: createdByType;

  /** The timestamp of resource creation (UTC). */
  createdAt?: utcDateTime;

  /** The identity that last modified the resource. */
  lastModifiedBy?: string;

  /** The type of identity that last modified the resource. */
  lastModifiedByType?: createdByType;

  /** The timestamp of resource last modification (UTC) */
  lastModifiedAt?: utcDateTime;
}

/**
 * The kind of entity that created the resource.
 */
// NOTE: This is how the extensible enum is named in types.json
union createdByType {
  /** The entity was created by a user. */
  User: "User",

  /** The entity was created by an application. */
  Application: "Application",

  /** The entity was created by a managed identity. */
  ManagedIdentity: "ManagedIdentity",

  /** The entity was created by a key. */
  Key: "Key",

  string,
}

/** @dev Resource Identity Type */
@doc("")
union ResourceIdentityType {
  SystemAssigned: "SystemAssigned",
}

/** Identity for the resource. */
@removed(Versions.v6)
model Identity {
  /** The principal ID of resource identity. The value must be an UUID. */
  @removed(Versions.v6)
  @typeChangedFrom(Versions.v4, string)
  @visibility(Lifecycle.Read)
  principalId?: uuid;

  /** The tenant ID of resource. The value must be an UUID. */
  @removed(Versions.v6)
  @typeChangedFrom(Versions.v4, string)
  @visibility(Lifecycle.Read)
  tenantId?: uuid;

  /** The identity type. */
  type?: ResourceIdentityType;
}

/** @dev Properties of a KeyVault */
model KeyVaultProperties {
  /** Key vault uri to access the encryption key. */
  keyIdentifier?: string;

  /** The client ID of the identity which will be used to access key vault. */
  identity?: string;
}
/**
 * Plan for the resource.
 */
model Plan {
  /** A user defined name of the 3rd Party Artifact that is being procured. */
  name: string;

  /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */
  publisher: string;

  /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */
  product: string;

  /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */
  promotionCode?: string;

  /** The version of the desired product/artifact. */
  version?: string;
}

/**
 * The check availability request body.
 */
model CheckNameAvailabilityRequest {
  /** The name of the resource for which availability needs to be checked. */
  name?: string;

  /** The resource type. */
  type?: string;
}

/**
 * The check availability result.
 */
model CheckNameAvailabilityResponse {
  /** Indicates if the resource name is available. */
  nameAvailable?: boolean;

  /** The reason why the given name is not available. */
  reason?: CheckNameAvailabilityReason;

  /** Detailed reason why the given name is not available. */
  message?: string;
}

/**
 * Possible reasons for a name not being available.
 */
union CheckNameAvailabilityReason {
  /** Name is invalid. */
  Invalid: "Invalid",

  /** Name already exists. */
  AlreadyExists: "AlreadyExists",

  string,
}

/** Indicates whether or not the encryption is enabled for container registry. */
union EncryptionStatus {
  /** Encryption is enabled. */
  enabled: "enabled",

  /** Encryption is disabled. */
  disabled: "disabled",

  string,
}
/**
 * Configuration of key for data encryption
 */
model EncryptionProperties {
  /** Indicates whether or not the encryption is enabled for container registry. */
  status?: EncryptionStatus;

  /** Key vault properties. */
  keyVaultProperties?: KeyVaultProperties;
}

/**
 * Metadata pertaining to the geographic location of the resource.
 */
model LocationData {
  /** A canonical name for the geographic or physical location. */
  @maxLength(256)
  name: string;

  /** The city or locality where the resource is located. */
  city?: string;

  /** The district, state, or province where the resource is located. */
  district?: string;

  /** The country or region where the resource is located */
  countryOrRegion?: string;
}

/**
 * The default api-version parameter type.
 *
 * @example
 * \`\`\`typespec
 * model Employee is TrackedResource<EmployeeProperties> {
 *  ...ResourceNameParameter<Employee>;
 * }
 * \`\`\`
 */
model ApiVersionParameter {
  /** The API version to use for this operation. */
  @query("api-version")
  @minLength(1)
  apiVersion: string;
}

/**
 * The default operationId parameter type.
 */
model OperationIdParameter {
  /** The ID of an ongoing async operation. */
  @path
  @minLength(1)
  operationId: string;
}

/**
 * The default location parameter type.
 *
 * @example
 * \`\`\`typespec
 * op employee is ArmProviderActionSync<
 *  Request = Employee,
 *  Response = Employee,
 *  Scope = SubscriptionActionScope,
 *  Parameters = LocationParameter
 * >;
 * \`\`\`
 */
model LocationParameter {
  /** The name of Azure region. */
  @path
  @minLength(1)
  @segment("locations")
  @Azure.ResourceManager.CommonTypes.Private.inlineAzureType
  location: string;
}

/**
 * The default resource group parameter type.
 */
model ResourceGroupNameParameter {
  /** The name of the resource group. The name is case insensitive. */
  @path
  @minLength(1)
  @maxLength(90)
  @segment("resourceGroups")
  @pattern("^[-\\\\w\\\\._\\\\(\\\\)]+$")
  resourceGroupName: string;
}

/**
 * The default subscriptionId parameter type.
 */
model SubscriptionIdParameter {
  /** The ID of the target subscription. The value must be an UUID. */
  @typeChangedFrom(Versions.v4, string)
  @path
  @segment("subscriptions")
  @minLength(1)
  subscriptionId: uuid;
}

/**
 * The default ManagementGroupName parameter type.
 */
@added(Versions.v4)
model ManagementGroupNameParameter {
  /** The name of the management group. The name is case insensitive. */
  @path
  @minLength(1)
  @maxLength(90)
  @segment("managementGroups")
  managementGroupName: string;
}

/**
 * The default Scope parameter type.
 */
@added(Versions.v4)
model ScopeParameter {
  /** The scope at which the operation is performed. */
  @path(#{ allowReserved: true })
  @segment("scope")
  @minLength(1)
  scope: string;
}

/**
 * The default TenantIdParameter type.
 */
@added(Versions.v4)
model TenantIdParameter {
  /** The Azure tenant ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000) */
  @path
  @segment("tenant")
  tenantId: uuid;
}

/**
 * The default ARM If-Match header type.
 */
@added(Versions.v4)
@friendlyName("If-Match")
model IfMatchHeader {
  /** The If-Match header that makes a request conditional. */
  @header("If-Match")
  ifMatch: string;
}

/**
 * The default ARM If-None-Match header type.
 */
@added(Versions.v4)
@friendlyName("If-None-Match")
model IfNoneMatchHeader {
  /** The If-None-Match header that makes a request conditional. */
  @header("If-None-Match")
  ifNoneMatch: string;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/managed-identity-ref.tsp":`import "./managed-identity.tsp";

using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager.CommonTypes;

/**
 * The properties of the managed service identities assigned to this resource.
 */
@@armCommonDefinition(
  ManagedServiceIdentity,
  "ManagedServiceIdentity",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "managedidentity.json"
);
@@armCommonDefinition(
  ManagedServiceIdentity,
  "ManagedServiceIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "managedidentity.json"
);
@@armCommonDefinition(
  ManagedServiceIdentity,
  "ManagedServiceIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "managedidentity.json"
);
@@armCommonDefinition(
  ManagedServiceIdentity,
  "ManagedServiceIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "managedidentity.json"
);

/** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", */
@@armCommonDefinition(
  UserAssignedIdentities,
  "UserAssignedIdentities",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "managedidentity.json"
);
@@armCommonDefinition(
  UserAssignedIdentities,
  "UserAssignedIdentities",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "managedidentity.json"
);
@@armCommonDefinition(
  UserAssignedIdentities,
  "UserAssignedIdentities",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "managedidentity.json"
);

/**
 * The properties of the service-assigned identity associated with this resource.
 */
@@armCommonDefinition(
  SystemAssignedServiceIdentity,
  "SystemAssignedServiceIdentity",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "managedidentity.json"
);
@@armCommonDefinition(
  SystemAssignedServiceIdentity,
  "SystemAssignedServiceIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "managedidentity.json"
);
@@armCommonDefinition(
  SystemAssignedServiceIdentity,
  "SystemAssignedServiceIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "managedidentity.json"
);
@@armCommonDefinition(
  SystemAssignedServiceIdentity,
  "SystemAssignedServiceIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "managedidentity.json"
);

/**
 * A managed identity assigned by the user.
 */
@@armCommonDefinition(
  UserAssignedIdentity,
  "UserAssignedIdentity",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "managedidentity.json"
);
@@armCommonDefinition(
  UserAssignedIdentity,
  "UserAssignedIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "managedidentity.json"
);
@@armCommonDefinition(
  UserAssignedIdentity,
  "UserAssignedIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "managedidentity.json"
);
@@armCommonDefinition(
  UserAssignedIdentity,
  "UserAssignedIdentity",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "managedidentity.json"
);

@@armCommonDefinition(
  ManagedServiceIdentityType,
  "ManagedServiceIdentityType",
  Azure.ResourceManager.CommonTypes.Versions.v3,
  "managedidentity.json"
);
@@armCommonDefinition(
  ManagedServiceIdentityType,
  "ManagedServiceIdentityType",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "managedidentity.json"
);
@@armCommonDefinition(
  ManagedServiceIdentityType,
  "ManagedServiceIdentityType",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "managedidentity.json"
);
@@armCommonDefinition(
  ManagedServiceIdentityType,
  "ManagedServiceIdentityType",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "managedidentity.json"
);

@@armCommonDefinition(
  SystemAssignedServiceIdentityType,
  "SystemAssignedServiceIdentityType",
  Azure.ResourceManager.CommonTypes.Versions.v3,
  "managedidentity.json"
);
@@armCommonDefinition(
  SystemAssignedServiceIdentityType,
  "SystemAssignedServiceIdentityType",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "managedidentity.json"
);
@@armCommonDefinition(
  SystemAssignedServiceIdentityType,
  "SystemAssignedServiceIdentityType",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "managedidentity.json"
);
@@armCommonDefinition(
  SystemAssignedServiceIdentityType,
  "SystemAssignedServiceIdentityType",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "managedidentity.json"
);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/managed-identity.tsp":`using Azure.Core;
using Versioning;

namespace Azure.ResourceManager.CommonTypes;

/** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */
#deprecated "Do not use this model. Instead, use Record<UserAssignedIdentity | null> directly. Using this model will result in a different client SDK when generated from TypeSpec compared to the Swagger."
@summary("User-Assigned Identities")
@removed(Versions.v6)
model UserAssignedIdentities is Record<UserAssignedIdentity | null>;

/**
 * Managed service identity (system assigned and/or user assigned identities)
 */
model ManagedServiceIdentity {
  /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */
  @visibility(Lifecycle.Read)
  principalId?: uuid;

  /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */
  @visibility(Lifecycle.Read)
  tenantId?: uuid;

  /** The type of managed identity assigned to this resource. */
  type: ManagedServiceIdentityType;

  /** The identities assigned to this resource by the user. */
  @typeChangedFrom(Versions.v5, Record<UserAssignedIdentity>)
  userAssignedIdentities?: Record<UserAssignedIdentity | null>;
}

/**
 * Managed service identity (either system assigned, or none)
 */
model SystemAssignedServiceIdentity {
  /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */
  @visibility(Lifecycle.Read)
  principalId?: uuid;

  /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */
  @visibility(Lifecycle.Read)
  tenantId?: uuid;

  /** The type of managed identity assigned to this resource. */
  type: SystemAssignedServiceIdentityType;
}

/**
 * User assigned identity properties
 */
model UserAssignedIdentity {
  /** The principal ID of the assigned identity. */
  @visibility(Lifecycle.Read)
  principalId?: uuid;

  /** The client ID of the assigned identity. */
  @visibility(Lifecycle.Read)
  clientId?: uuid;
}

/**
 * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
 */
union ManagedServiceIdentityType {
  /** No managed identity. */
  "None",

  /** System assigned managed identity. */
  "SystemAssigned",

  /** User assigned managed identity. */
  "UserAssigned",

  /** System and user assigned managed identity. */
  @added(Versions.v3)
  @removed(Versions.v4)
  @added(Versions.v5)
  "SystemAssigned,UserAssigned",

  /** System and user assigned managed identity. */
  @added(Versions.v4)
  @removed(Versions.v5)
  "SystemAssigned, UserAssigned",

  string,
}

/**
 * Type of managed service identity (either system assigned, or none).
 */
union SystemAssignedServiceIdentityType {
  /** No managed system identity. */
  None: "None",

  /** System assigned managed system identity. */
  SystemAssigned: "SystemAssigned",

  string,
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/managed-identity-with-delegation-ref.tsp":`import "./managed-identity-with-delegation.tsp";
using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager.CommonTypes;

/** Managed service identity (system assigned and/or user assigned identities and/or delegated identities) - internal use only. */
@@armCommonDefinition(
  ManagedServiceIdentityWithDelegation,
  "ManagedServiceIdentityWithDelegation",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "managedidentitywithdelegation.json"
);
@@armCommonDefinition(
  ManagedServiceIdentityWithDelegation,
  "ManagedServiceIdentityWithDelegation",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "managedidentitywithdelegation.json"
);
@@armCommonDefinition(
  ManagedServiceIdentityWithDelegation,
  "ManagedServiceIdentityWithDelegation",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "managedidentitywithdelegation.json"
);

/** Delegated resource properties - internal use only. */
@@armCommonDefinition(
  DelegatedResource,
  "DelegatedResource",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "managedidentitywithdelegation.json"
);
@@armCommonDefinition(
  DelegatedResource,
  "DelegatedResource",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "managedidentitywithdelegation.json"
);
@@armCommonDefinition(
  DelegatedResource,
  "DelegatedResource",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "managedidentitywithdelegation.json"
);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/managed-identity-with-delegation.tsp":`using Azure.Core;
using Versioning;

namespace Azure.ResourceManager.CommonTypes;

/** Managed service identity (system assigned and/or user assigned identities and/or delegated identities) - internal use only. */
@added(Versions.v4)
model ManagedServiceIdentityWithDelegation extends ManagedServiceIdentity {
  delegatedResources?: DelegatedResources;
}

/** The set of delegated resources. The delegated resources dictionary keys will be source resource internal ids - internal use only. */
@added(Versions.v4)
model DelegatedResources {
  ...Record<DelegatedResource>;
}

/** Delegated resource properties - internal use only. */
@added(Versions.v4)
model DelegatedResource {
  /** The ARM resource id of the delegated resource - internal use only. */
  resourceId?: string;

  /** The tenant id of the delegated resource - internal use only. */
  tenantId?: uuid;

  /** The delegation id of the referral delegation (optional) - internal use only. */
  referralResource?: string;

  /** The source resource location - internal use only. */
  location?: string;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/private-links-ref.tsp":`import "./private-links.tsp";

using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager.CommonTypes;

/** The private endpoint */
@@armCommonDefinition(
  PrivateEndpoint,
  "PrivateEndpoint",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpoint,
  "PrivateEndpoint",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpoint,
  "PrivateEndpoint",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpoint,
  "PrivateEndpoint",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);

/** The private endpoint resource */
@@armCommonDefinition(
  PrivateLinkResource,
  "PrivateLinkResource",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResource,
  "PrivateLinkResource",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResource,
  "PrivateLinkResource",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResource,
  "PrivateLinkResource",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);

/** PrivateEndpointConnection */
@@armCommonDefinition(
  PrivateEndpointConnection,
  "PrivateEndpointConnection",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnection,
  "PrivateEndpointConnection",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnection,
  "PrivateEndpointConnection",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnection,
  "PrivateEndpointConnection",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);

/** Properties of the private endpoint connection resource */
@@armCommonDefinition(
  PrivateEndpointConnectionProperties,
  "PrivateEndpointConnectionProperties",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnectionProperties,
  "PrivateEndpointConnectionProperties",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnectionProperties,
  "PrivateEndpointConnectionProperties",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnectionProperties,
  "PrivateEndpointConnectionProperties",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);

/** A collection of information about the state of the connection between service consumer and provider. */
@@armCommonDefinition(
  PrivateLinkServiceConnectionState,
  "PrivateLinkServiceConnectionState",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkServiceConnectionState,
  "PrivateLinkServiceConnectionState",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkServiceConnectionState,
  "PrivateLinkServiceConnectionState",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkServiceConnectionState,
  "PrivateLinkServiceConnectionState",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);

/** Properties of a private link resource. */
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "Matches current common code"
@@armCommonDefinition(
  PrivateLinkResourceProperties,
  "PrivateLinkResourceProperties",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResourceProperties,
  "PrivateLinkResourceProperties",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResourceProperties,
  "PrivateLinkResourceProperties",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResourceProperties,
  "PrivateLinkResourceProperties",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);

/** PrivateEndpointConnectionListResult */
@@armCommonDefinition(
  PrivateEndpointConnectionListResultV5,
  "PrivateEndpointConnectionListResult",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnectionListResultV5,
  "PrivateEndpointConnectionListResult",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnectionListResultV5,
  "PrivateEndpointConnectionListResult",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnectionListResult,
  "PrivateEndpointConnectionListResult",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);

/** PrivateLinkResourceListResult */
@@armCommonDefinition(
  PrivateLinkResourceListResultV5,
  "PrivateLinkResourceListResult",
  Azure.ResourceManager.CommonTypes.Versions.v3,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResourceListResultV5,
  "PrivateLinkResourceListResult",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResourceListResultV5,
  "PrivateLinkResourceListResult",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateLinkResourceListResult,
  "PrivateLinkResourceListResult",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);

// PrivateEndpointServiceConnectionStatus
@@armCommonDefinition(
  PrivateEndpointServiceConnectionStatus,
  "PrivateEndpointServiceConnectionStatus",
  Azure.ResourceManager.CommonTypes.Versions.v3,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointServiceConnectionStatus,
  "PrivateEndpointServiceConnectionStatus",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  PrivateEndpointServiceConnectionStatus,
  "PrivateEndpointServiceConnectionStatus",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  PrivateEndpointServiceConnectionStatus,
  "PrivateEndpointServiceConnectionStatus",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

// PrivateEndpointServiceConnectionStatus
@@armCommonDefinition(
  PrivateEndpointConnectionProvisioningState,
  "PrivateEndpointConnectionProvisioningState",
  Azure.ResourceManager.CommonTypes.Versions.v3,
  "privatelinks.json"
);
@@armCommonDefinition(
  PrivateEndpointConnectionProvisioningState,
  "PrivateEndpointConnectionProvisioningState",
  Azure.ResourceManager.CommonTypes.Versions.v4
);
@@armCommonDefinition(
  PrivateEndpointConnectionProvisioningState,
  "PrivateEndpointConnectionProvisioningState",
  Azure.ResourceManager.CommonTypes.Versions.v5
);
@@armCommonDefinition(
  PrivateEndpointConnectionProvisioningState,
  "PrivateEndpointConnectionProvisioningState",
  Azure.ResourceManager.CommonTypes.Versions.v6
);

/** PrivateEndpointConnectionParameter */
@@CommonTypes.Private.armCommonParameter(
  PrivateEndpointConnectionParameter.name,
  "PrivateEndpointConnectionName",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v3, isDefault: true },
  "privatelinks.json"
);
@@CommonTypes.Private.armCommonParameter(
  PrivateEndpointConnectionParameter.name,
  "PrivateEndpointConnectionName",
  Azure.ResourceManager.CommonTypes.Versions.v4,
  "privatelinks.json"
);
@@CommonTypes.Private.armCommonParameter(
  PrivateEndpointConnectionParameter.name,
  "PrivateEndpointConnectionName",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "privatelinks.json"
);
@@CommonTypes.Private.armCommonParameter(
  PrivateEndpointConnectionParameter.name,
  "PrivateEndpointConnectionName",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "privatelinks.json"
);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/private-links.tsp":`using Http;
using Versioning;

using Azure.Core;

namespace Azure.ResourceManager.CommonTypes;

/** The private endpoint resource. */
model PrivateEndpoint {
  /** The resource identifier of the private endpoint */
  @visibility(Lifecycle.Read)
  @typeChangedFrom(CommonTypes.Versions.v4, string)
  id?: Azure.Core.armResourceIdentifier;
}

/** A private link resource. */
model PrivateLinkResource extends Resource {
  /** Resource properties. */
  properties?: PrivateLinkResourceProperties;
}

/** Properties of a private link resource. */
model PrivateLinkResourceProperties {
  /** The private link resource group id. */
  @visibility(Lifecycle.Read)
  groupId?: string;

  /** The private link resource required member names. */
  @visibility(Lifecycle.Read)
  requiredMembers?: string[];

  /** The private link resource private link DNS zone name. */
  requiredZoneNames?: string[];
}

/** A list of private link resources. */
@added(Versions.v6)
model PrivateLinkResourceListResult {
  /** Array of private link resources */
  @identifiers(#["id"])
  @pageItems
  value?: PrivateLinkResource[];

  /** URL to get the next set of operation list results (if there are any). */
  @visibility(Lifecycle.Read)
  @nextLink
  nextLink?: url;
}
//#region
/** The private endpoint connection resource */
model PrivateEndpointConnection extends Resource {
  /** The private endpoint connection properties */
  properties?: PrivateEndpointConnectionProperties;
}

/** List of private endpoint connections associated with the specified resource. */
@added(Versions.v6)
model PrivateEndpointConnectionListResult {
  /** Array of private endpoint connections. */
  @identifiers(#["id"])
  @pageItems
  value?: PrivateEndpointConnection[];

  /** URL to get the next set of operation list results (if there are any). */
  @visibility(Lifecycle.Read)
  @nextLink
  nextLink?: url;
}

/** Properties of the private endpoint connection. */
model PrivateEndpointConnectionProperties {
  /** The group ids for the private endpoint resource. */
  @visibility(Lifecycle.Read)
  @added(Versions.v4)
  groupIds?: string[];

  /** The private endpoint resource. */
  privateEndpoint?: PrivateEndpoint;

  /** A collection of information about the state of the connection between service consumer and provider. */
  privateLinkServiceConnectionState: PrivateLinkServiceConnectionState;

  /** The provisioning state of the private endpoint connection resource. */
  @visibility(Lifecycle.Read)
  provisioningState?: PrivateEndpointConnectionProvisioningState;
}

/** A collection of information about the state of the connection between service consumer and provider. */
model PrivateLinkServiceConnectionState {
  /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */
  status?: PrivateEndpointServiceConnectionStatus;

  /** The reason for approval/rejection of the connection. */
  description?: string;

  /** A message indicating if changes on the service provider require any updates on the consumer. */
  actionsRequired?: string;
}

/** The current provisioning state. */
union PrivateEndpointConnectionProvisioningState {
  string,

  /** Connection has been provisioned */
  Succeeded: "Succeeded",

  /** Connection is being created */
  Creating: "Creating",

  /** Connection is being deleted */
  Deleting: "Deleting",

  /** Connection provisioning has failed */
  Failed: "Failed",
}

/** The private endpoint connection status. */
union PrivateEndpointServiceConnectionStatus {
  /** Connection waiting for approval or rejection */
  Pending: "Pending",

  /** Connection approved */
  Approved: "Approved",

  /** Connection Rejected */
  Rejected: "Rejected",

  string,
}

/**
 * The name of the private endpoint connection associated with the Azure resource.
 */
model PrivateEndpointConnectionParameter {
  /** The name of the private endpoint connection associated with the Azure resource. */
  @path
  @key("privateEndpointConnectionName")
  @TypeSpec.Rest.segment("privateEndpointConnections")
  name: string;
}

/**
 * The name of the private endpoint connection associated with the Azure resource.
 * @template KeyName The name of the private endpoint connection name parameter (default is "privateEndpointConnectionName")
 * @template ResourceNamePattern The regex pattern for the private endpoint connection name (default is "^[a-z][a-zA-Z0-9]*$")
 * @template MinLength The minimum length for the private endpoint connection name (default is 3)
 * @template MaxLength The maximum length for the private endpoint connection name (default is 63
 */
model PrivateEndpointConnectionNameParameter<
  KeyName extends valueof string = string("privateEndpointConnectionName"),
  ResourceNamePattern extends valueof string = string("^[a-z][a-zA-Z0-9]*$"),
  MinLength extends valueof int32 = 3,
  MaxLength extends valueof int32 = 63
> {
  /** The name of the private endpoint connection associated with the Azure resource. */
  @minLength(MinLength)
  @maxLength(MaxLength)
  @pattern(ResourceNamePattern)
  @path
  @key(KeyName)
  @TypeSpec.Rest.segment("privateEndpointConnections")
  name: string;
}

/**
 * The name of the private link associated with the Azure resource.
 * @template Segment The resource type name for private links (default is privateLinkResources)
 */
model PrivateLinkResourceParameter<Segment extends valueof string = "privateLinkResources"> {
  /** The name of the private link associated with the Azure resource. */
  @path
  @key("privateLinkResourceName")
  @TypeSpec.Rest.segment(Segment)
  name: string;
}

/**
 * The name of the private link associated with the Azure resource.
 * @template Segment The resource type name for private links (default is privateLinkResources)
 * @template ResourceNamePattern The regex pattern for the private link resource name (default is "^[a-z][a-zA-Z0-9]*$")
 * @template MinLength The minimum length for the private link resource name (default is 3)
 * @template MaxLength The maximum length for the private link resource name (default is 63
 */
model PrivateLinkResourceNameParameter<
  Segment extends valueof string = "privateLinkResources",
  ResourceNamePattern extends valueof string = string("^[a-z][a-zA-Z0-9]*$"),
  MinLength extends valueof int32 = 3,
  MaxLength extends valueof int32 = 63
> {
  /** The name of the private link associated with the Azure resource. */
  @minLength(MinLength)
  @maxLength(MaxLength)
  @pattern(ResourceNamePattern)
  @path
  @TypeSpec.Rest.segment(Segment)
  @key("privateLinkResourceName")
  name: string;
}

/**
 * A list of private link resources for versions before v6.
 *
 * This model represents the standard \`PrivateLinkResourceListResult\` envelope for versions v3, v4, and v5. It has been deprecated for v6 and beyond.
 *
 * Note: This is only intended for use with versions before v6. Do not use this if you are already on CommonTypes.Version.v6 or beyond.
 *
 * If you are migrating to v6 or above, use \`PrivateLinkResourceListResult\` directly.
 *
 *  @example
 *  Version: v3,v4,v5
 * \`\`\`typespec
 * @armResourceOperations
 * interface Employees {
 *   listConnections is ArmResourceActionAsync<Employee, {}, PrivateLinkResourceListResultV5>;
 * }
 * \`\`\`
 *
 * Version: v6
 * \`\`\`typespec
 * @armResourceOperations
 * interface Employees {
 *   listConnections is ArmResourceActionAsync<Employee, {}, PrivateLinkResourceListResult>;
 * }
 * \`\`\`
 */
#deprecated "Avoid using this model. Instead, use PrivateLinkResourceListResult available in CommonTypes.Version.v6 or beyond."
@friendlyName("PrivateLinkResourceListResult")
@removed(Versions.v6)
model PrivateLinkResourceListResultV5 {
  /** Array of private link resources */
  @identifiers(#["id"])
  @pageItems
  value?: CommonTypes.PrivateLinkResource[];
}

/**
 * List of private endpoint connections associated with the specified resource before version v6.
 *
 * This model represents the standard \`PrivateEndpointConnectionResourceListResult\` envelope for versions v3, v4, and v5. It has been deprecated for v6 and beyond.
 *
 * Note: This is only intended for use with versions before v6. Do not use this if you are already on CommonTypes.Version.v6 or beyond.
 *
 * If you are migrating to v6 or above, use \`PrivateEndpointConnectionResourceListResult\` directly.
 *
 * @example
 * Version: v3,v4,v5
 * \`\`\`typespec
 * @armResourceOperations
 * interface Employees {
 *   createConnection is ArmResourceActionAsync<
 *     Employee,
 *     PrivateEndpointConnection,
 *     PrivateEndpointConnectionResourceListResultV5
 *   >;
 * }
 * \`\`\`
 *
 * Version: v6
 * \`\`\`typespec
 * @armResourceOperations
 * interface Employees {
 *   createConnection is ArmResourceActionAsync<
 *     Employee,
 *     PrivateEndpointConnection,
 *     PrivateEndpointConnectionResourceListResult
 *   >;
 * }
 * \`\`\`
 */
#deprecated "Avoid using this model. Instead, use PrivateEndpointConnectionResourceListResult available in CommonTypes.Version.v6 or beyond."
@friendlyName("PrivateEndpointConnectionListResult")
@removed(Versions.v6)
model PrivateEndpointConnectionListResultV5 {
  /** Array of private endpoint connections. */
  @identifiers(#["id"])
  @pageItems
  value?: CommonTypes.PrivateEndpointConnection[];
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys-ref.tsp":`import "./customer-managed-keys.tsp";

using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager.CommonTypes;

@@armCommonDefinition(
  Encryption,
  "encryption",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true },
  "customermanagedkeys.json"
);
@@armCommonDefinition(
  Encryption,
  "encryption",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "customermanagedkeys.json"
);
@@armCommonDefinition(
  Encryption,
  "encryption",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "customermanagedkeys.json"
);

@@armCommonDefinition(
  CustomerManagedKeyEncryption,
  "customerManagedKeyEncryption",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true },
  "customermanagedkeys.json"
);
@@armCommonDefinition(
  CustomerManagedKeyEncryption,
  "customerManagedKeyEncryption",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "customermanagedkeys.json"
);
@@armCommonDefinition(
  CustomerManagedKeyEncryption,
  "customerManagedKeyEncryption",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "customermanagedkeys.json"
);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/customer-managed-keys.tsp":`using Azure.Core;
using Versioning;

namespace Azure.ResourceManager.CommonTypes;

/** (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. */
@added(Versions.v4)
union InfrastructureEncryption {
  /** Encryption is enabled */
  Enabled: "enabled",

  /** Encryption is disabled */
  Disabled: "disabled",

  string,
}

/** The type of identity to use. */
@added(Versions.v4)
union KeyEncryptionKeyIdentityType {
  /** System assigned identity */
  SystemAssignedIdentity: "systemAssignedIdentity",

  /** User assigned identity */
  UserAssignedIdentity: "userAssignedIdentity",

  /** Delegated identity */
  DelegatedResourceIdentity: "delegatedResourceIdentity",

  string,
}

/** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */
@added(Versions.v4)
model KeyEncryptionKeyIdentity {
  /** The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. */
  identityType?: KeyEncryptionKeyIdentityType;

  /** User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity. */
  userAssignedIdentityResourceId?: Azure.Core.armResourceIdentifier;

  /** application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540 */
  @added(Versions.v5)
  federatedClientId?: uuid;

  /** delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. */
  delegatedIdentityClientId?: uuid;
}

/** Customer-managed key encryption properties for the resource. */
@added(Versions.v4)
model CustomerManagedKeyEncryption {
  /** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */
  keyEncryptionKeyIdentity?: KeyEncryptionKeyIdentity;

  /** key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. */
  keyEncryptionKeyUrl?: string;
}

/** (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. */
@added(Versions.v4)
@encodedName("application/json", "encryption")
model Encryption {
  /** Values are enabled and disabled. */
  infrastructureEncryption?: InfrastructureEncryption;

  /** All Customer-managed key encryption properties for the resource. */
  @added(Versions.v4)
  customerManagedKeyEncryption?: CustomerManagedKeyEncryption;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/extended-location-ref.tsp":`import "./extended-location.tsp";
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/extended-location.tsp":`namespace Azure.ResourceManager.CommonTypes;
/** The complex type of the extended location. */
model ExtendedLocation {
  /** The name of the extended location. */
  name: string;

  /** The type of the extended location. */
  type: ExtendedLocationType;
}

/** The supported ExtendedLocation types. */
union ExtendedLocationType {
  /** Azure Edge Zones location type */
  EdgeZone: "EdgeZone",

  /** Azure Custom Locations type */
  CustomLocation: "CustomLocation",

  string,
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/internal.tsp":`namespace Azure.ResourceManager.CommonTypes;

/**
 * An internal enum to indicate the resource support for various path types
 */
enum ResourceHome {
  @doc("The resource is bound to a tenant")
  Tenant,

  @doc("The resource is bound to a subscription")
  Subscription,

  @doc("The resource is bound to a location")
  Location,

  @doc("The resource is bound to a resource group")
  ResourceGroup,

  @doc("The resource is bound to an extension")
  Extension,

  @doc("The resource is a built in tenant resource")
  BuiltIn,

  @doc("The resource is a built in subscription resource")
  BuiltInSubscription,

  @doc("The resource is a built in resource group resource")
  BuiltInResourceGroup,
}

/** Alias of keyEncryptionKeyIdentity for back compatibility. Please change to keyEncryptionKeyIdentity. */
alias KeyEncryptionIdentity = KeyEncryptionKeyIdentity;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/commontypes.private.decorators.tsp":`import "../../dist/src/commontypes.private.decorators.js";

namespace Azure.ResourceManager.CommonTypes.Private;

using Reflection;

/**
 * Describes the shape of model literals accepted by the \`version\` parameter of
 * the \`armCommonDefinition\` and \`armCommonParameter\` decorators.
 */
alias ArmCommonTypeVersionSpec = {
  version: string | EnumMember;
  isDefault: boolean;
};

/**
 * @param definitionName Definition name
 * @param version Azure Resource Manager Version
 * @param referenceFile Reference file
 */
extern dec armCommonDefinition(
  target: Model | Enum | Union,
  definitionName?: valueof string,
  version?: valueof EnumMember | ArmCommonTypeVersionSpec | string,
  referenceFile?: valueof string
);

/**
 * @param definitionName Definition name
 * @param version Azure Resource Manager Version
 * @param referenceFile Reference file
 */
extern dec armCommonParameter(
  target: ModelProperty,
  definitionName?: valueof string,
  version?: valueof EnumMember | ArmCommonTypeVersionSpec | string,
  referenceFile?: valueof string
);

/**
 * Marks an enum as representing the valid \`common-types\` versions.
 */
extern dec armCommonTypesVersions(target: Enum);

/**
 * Signifies that a property can be treated as an inline type in emitters
 */
extern dec inlineAzureType(target: ModelProperty);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/versions.tsp":`import "./commontypes.private.decorators.tsp";

using Versioning;

@versioned(Versions)
namespace Azure.ResourceManager.CommonTypes;

@Azure.ResourceManager.CommonTypes.Private.armCommonTypesVersions
@doc("The Azure Resource Manager common-types versions.")
enum Versions {
  @doc("The Azure Resource Manager v3 common types.")
  v3,

  @doc("The Azure Resource Manager v4 common types.")
  v4,

  @doc("The Azure Resource Manager v5 common types.")
  v5,

  @doc("The Azure Resource Manager v6 common types.")
  v6,
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/mobo-ref.tsp":`import "./mobo.tsp";
using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager.CommonTypes;

/** This configuration exists for the resources where a resource provider manages those resources on behalf of the resource owner. */
@@armCommonDefinition(
  ManagedOnBehalfOfConfiguration,
  "ManagedOnBehalfOfConfiguration",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "mobo.json"
);
@@armCommonDefinition(
  ManagedOnBehalfOfConfiguration,
  "ManagedOnBehalfOfConfiguration",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "mobo.json"
);

/** This resource is created by the Resource Provider to manage some resources on behalf of the user. */
@@armCommonDefinition(
  MoboBrokerResource,
  "MoboBrokerResource",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "mobo.json"
);
@@armCommonDefinition(
  MoboBrokerResource,
  "MoboBrokerResource",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "mobo.json"
);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/mobo.tsp":`using Azure.Core;
using Versioning;

namespace Azure.ResourceManager.CommonTypes;

/** Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider manages those resources on behalf of the resource owner. */
@added(Versions.v5)
model ManagedOnBehalfOfConfiguration {
  /** Managed-On-Behalf-Of broker resources */
  @visibility(Lifecycle.Read)
  moboBrokerResources?: MoboBrokerResource[];
}

/** Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on behalf of the user. */
@added(Versions.v5)
model MoboBrokerResource {
  /** Resource identifier of a Managed-On-Behalf-Of broker resource */
  id?: Azure.Core.armResourceIdentifier;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/network-security-perimeter-ref.tsp":`import "./network-security-perimeter.tsp";

using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager.CommonTypes;

/** Direction of Access Rule */
@@armCommonDefinition(
  AccessRuleDirection,
  "AccessRuleDirection",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  AccessRuleDirection,
  "AccessRuleDirection",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Provisioning state of a network security perimeter configuration that is being created or updated. */
@@armCommonDefinition(
  NetworkSecurityPerimeterConfigurationProvisioningState,
  "NetworkSecurityPerimeterConfigurationProvisioningState",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  NetworkSecurityPerimeterConfigurationProvisioningState,
  "NetworkSecurityPerimeterConfigurationProvisioningState",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Type of issue */
@@armCommonDefinition(
  IssueType,
  "IssueType",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  IssueType,
  "IssueType",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Severity of the issue. */
@@armCommonDefinition(
  Severity,
  "Severity",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  Severity,
  "Severity",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Access mode of the resource association */
@@armCommonDefinition(
  ResourceAssociationAccessMode,
  "ResourceAssociationAccessMode",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  ResourceAssociationAccessMode,
  "ResourceAssociationAccessMode",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Allow, disallow, or let network security perimeter configuration control public network access to the protected resource. */
@@armCommonDefinition(
  PublicNetworkAccess,
  "PublicNetworkAccess",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  PublicNetworkAccess,
  "PublicNetworkAccess",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Access rule in a network security perimeter configuration profile */
@@armCommonDefinition(
  AccessRule,
  "AccessRule",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  AccessRule,
  "AccessRule",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Properties of Access Rule */
@@armCommonDefinition(
  AccessRuleDirection,
  "AccessRuleDirection",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  AccessRuleDirection,
  "AccessRuleDirection",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Information about a network security perimeter */
@@armCommonDefinition(
  NetworkSecurityPerimeter,
  "NetworkSecurityPerimeter",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  NetworkSecurityPerimeter,
  "NetworkSecurityPerimeter",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

@@Versioning.added(NetworkSecurityPerimeterConfiguration, Versions.v5);
/** Network security perimeter configuration resource */
@@armCommonDefinition(
  NetworkSecurityPerimeterConfiguration,
  "NetworkSecurityPerimeterConfiguration",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  NetworkSecurityPerimeterConfiguration,
  "NetworkSecurityPerimeterConfiguration",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Network security configuration properties. */
@@armCommonDefinition(
  NetworkSecurityPerimeterConfigurationProperties,
  "NetworkSecurityPerimeterConfigurationProperties",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  NetworkSecurityPerimeterConfigurationProperties,
  "NetworkSecurityPerimeterConfigurationProperties",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Describes a provisioning issue for a network security perimeter configuration */
@@armCommonDefinition(
  ProvisioningIssue,
  "ProvisioningIssue",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  ProvisioningIssue,
  "ProvisioningIssue",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Details of a provisioning issue for a network security perimeter configuration. */
@@armCommonDefinition(
  ProvisioningIssueProperties,
  "ProvisioningIssueProperties",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  ProvisioningIssueProperties,
  "ProvisioningIssueProperties",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Information about resource association */
@@armCommonDefinition(
  ResourceAssociation,
  "ResourceAssociation",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  ResourceAssociation,
  "ResourceAssociation",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Network security perimeter configuration profile */
@@armCommonDefinition(
  NetworkSecurityProfile,
  "NetworkSecurityProfile",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  NetworkSecurityProfile,
  "NetworkSecurityProfile",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);

/** Result of a list NSP (network security perimeter) configurations request. */
@@armCommonDefinition(
  NetworkSecurityPerimeterConfigurationListResult,
  "NetworkSecurityPerimeterConfigurationListResult",
  Azure.ResourceManager.CommonTypes.Versions.v5,
  "networksecurityperimeter.json"
);
@@armCommonDefinition(
  NetworkSecurityPerimeterConfigurationListResult,
  "NetworkSecurityPerimeterConfigurationListResult",
  Azure.ResourceManager.CommonTypes.Versions.v6,
  "networksecurityperimeter.json"
);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/network-security-perimeter.tsp":`using Http;
using Versioning;
using Azure.Core;

@server(
  "https://management.azure.com",
  "The endpoint for network security perimeter common type definitions"
)
namespace Azure.ResourceManager.CommonTypes;

/** Direction of Access Rule */
@added(Versions.v5)
union AccessRuleDirection {
  string,

  /** Applies to inbound network traffic to the secured resources. */
  Inbound: "Inbound",

  /** Applies to outbound network traffic from the secured resources */
  Outbound: "Outbound",
}

/** Provisioning state of a network security perimeter configuration that is being created or updated. */
@added(Versions.v5)
union NetworkSecurityPerimeterConfigurationProvisioningState {
  string,
  Succeeded: "Succeeded",
  Creating: "Creating",
  Updating: "Updating",
  Deleting: "Deleting",
  Accepted: "Accepted",
  Failed: "Failed",
  Canceled: "Canceled",
}

/** Type of issue */
@added(Versions.v5)
union IssueType {
  string,

  /** Unknown issue type */
  Unknown: "Unknown",

  /** An error occurred while applying the network security perimeter (NSP) configuration. */
  ConfigurationPropagationFailure: "ConfigurationPropagationFailure",

  /** A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. */
  MissingPerimeterConfiguration: "MissingPerimeterConfiguration",

  /** An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. */
  MissingIdentityConfiguration: "MissingIdentityConfiguration",
}

/** Severity of the issue. */
@added(Versions.v5)
union Severity {
  string,
  Warning: "Warning",
  Error: "Error",
}

/** Access mode of the resource association */
@added(Versions.v5)
union ResourceAssociationAccessMode {
  string,

  /** Enforced access mode - traffic to the resource that failed access checks is blocked */
  Enforced: "Enforced",

  /** Learning access mode - traffic to the resource is enabled for analysis but not blocked */
  Learning: "Learning",

  /** Audit access mode - traffic to the resource that fails access checks is logged but not blocked */
  Audit: "Audit",
}

/** Allow, disallow, or let network security perimeter configuration control public network access to the protected resource. Value is optional but if passed in, it must be 'Enabled', 'Disabled' or 'SecuredByPerimeter'. */
@added(Versions.v5)
union PublicNetworkAccess {
  string,

  /** Allows public network access to the resource */
  Enabled: "Enabled",

  /** Disallows public network access to the resource */
  Disabled: "Disabled",

  /** The network security perimeter configuration rules allow or disallow public network access to the resource. Requires an associated network security perimeter. */
  SecuredByPerimeter: "SecuredByPerimeter",
}

/** Access rule in a network security perimeter configuration profile */
@added(Versions.v5)
model AccessRule {
  /** Name of the access rule */
  name?: string;

  properties?: AccessRuleProperties;
}

/** Properties of Access Rule */
@added(Versions.v5)
model AccessRuleProperties {
  direction?: AccessRuleDirection;

  /** Address prefixes in the CIDR format for inbound rules */
  addressPrefixes?: string[];

  /** Subscriptions for inbound rules */
  subscriptions?: {
    /** The fully qualified Azure resource ID of the subscription e.g. ('/subscriptions/00000000-0000-0000-0000-000000000000') */
    id?: Azure.Core.armResourceIdentifier;
  }[];

  /** Network security perimeters for inbound rules */
  networkSecurityPerimeters?: NetworkSecurityPerimeter[];

  /** Fully qualified domain names (FQDN) for outbound rules */
  fullyQualifiedDomainNames?: string[];

  /** Email addresses for outbound rules */
  emailAddresses?: string[];

  /** Phone numbers for outbound rules */
  phoneNumbers?: string[];
}

/** Information about a network security perimeter (NSP) */
@added(Versions.v5)
model NetworkSecurityPerimeter {
  /** Fully qualified Azure resource ID of the NSP resource */
  id?: Azure.Core.armResourceIdentifier<[
    {
      type: "Microsoft.Network/networkSecurityPerimeters";
    }
  ]>;

  /** Universal unique ID (UUID) of the network security perimeter */
  perimeterGuid?: uuid;

  /** Location of the network security perimeter */
  @visibility(Lifecycle.Read, Lifecycle.Create)
  location?: string;
}

/** Network security perimeter (NSP) configuration resource */
@added(Versions.v5)
model NetworkSecurityPerimeterConfiguration extends ProxyResource {
  properties?: NetworkSecurityPerimeterConfigurationProperties;
}

/** Network security configuration properties. */
@added(Versions.v5)
model NetworkSecurityPerimeterConfigurationProperties {
  @visibility(Lifecycle.Read)
  provisioningState?: NetworkSecurityPerimeterConfigurationProvisioningState;

  /** List of provisioning issues, if any */
  @visibility(Lifecycle.Read)
  @Azure.ResourceManager.identifiers(#[])
  provisioningIssues?: ProvisioningIssue[];

  networkSecurityPerimeter?: NetworkSecurityPerimeter;
  resourceAssociation?: ResourceAssociation;
  profile?: NetworkSecurityProfile;
}

/** Describes a provisioning issue for a network security perimeter configuration */
@added(Versions.v5)
model ProvisioningIssue {
  /** Name of the issue */
  @visibility(Lifecycle.Read)
  name?: string;

  @visibility(Lifecycle.Read)
  properties?: ProvisioningIssueProperties;
}

/** Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules */
@added(Versions.v5)
model ProvisioningIssueProperties {
  /** Type of issue */
  @visibility(Lifecycle.Read)
  issueType?: IssueType;

  /** Severity of the issue. */
  @visibility(Lifecycle.Read)
  severity?: Severity;

  /** Description of the issue */
  @visibility(Lifecycle.Read)
  description?: string;

  /** Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. */
  @visibility(Lifecycle.Read)
  suggestedResourceIds?: Azure.Core.armResourceIdentifier[];

  /** Access rules that can be added to the network security profile (NSP) to remediate the issue. */
  @visibility(Lifecycle.Read)
  @Azure.ResourceManager.identifiers(#[])
  suggestedAccessRules?: AccessRule[];
}

/** Information about resource association */
@added(Versions.v5)
model ResourceAssociation {
  /** Name of the resource association */
  name?: string;

  accessMode?: ResourceAssociationAccessMode;
}

/** Network security perimeter configuration profile */
@added(Versions.v5)
model NetworkSecurityProfile {
  /** Name of the profile */
  name?: string;

  /** Current access rules version */
  accessRulesVersion?: int32;

  /** List of Access Rules */
  @Azure.ResourceManager.identifiers(#["name"])
  accessRules?: AccessRule[];

  /** Current diagnostic settings version */
  diagnosticSettingsVersion?: int32;

  /** List of log categories that are enabled */
  enabledLogCategories?: string[];
}

/** Result of a list NSP (network security perimeter) configurations request. */
@added(Versions.v5)
model NetworkSecurityPerimeterConfigurationListResult {
  /** Array of network security perimeter results. */
  value?: NetworkSecurityPerimeterConfiguration[];

  /** The link used to get the next page of results. */
  nextLink?: url;
}

/**
 * The name for a network security perimeter configuration
 */
@added(Versions.v5)
model NetworkSecurityPerimeterConfigurationNameParameter {
  /** The name for a network security perimeter configuration */
  @path
  @minLength(1)
  @maxLength(512)
  @TypeSpec.Rest.segment("networkSecurityPerimeterConfigurations")
  @key("networkSecurityPerimeterConfigurationName")
  networkSecurityPerimeterConfigurationName: string;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/common-types/nsp-operations.tsp":`using Http;
using Rest;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;

namespace Azure.ResourceManager.CommonTypes;

/** Network security perimeter (NSP) configuration resource. Providers must instantiate an instance of this resource in their
 * provider namespace to enable NSP capabilities for their resources.
 *
 * @template KeyName Optional. The name of the NSP configuration resource name parameter. By default, this is \`networkSecurityPerimeterConfigurationName\`.
 * @template Description Optional. The documentary description of the NSP configuration resource name parameter.
 *
 * @example
 * \`\`\`ts
 * namespace Microsoft.Contoso;
 * model NspConfiguration is NspConfigurationResource {}
 * alias EmployeeConfigOps is NspConfigurations<NspConfiguration>;
 * @armResourceOperations
 * interface Employees {
 *  @doc("get a network security perimeter configuration for resource employee")
 *  getNspConfiguration is EmployeeConfigOps.Read<Employee>;
 * }
 * \`\`\`
 */
@Versioning.added(Versions.v5)
@doc(Description)
@armResourceWithParameter(
  NetworkSecurityPerimeterConfigurationProperties,
  "networkSecurityPerimeterConfigurations",
  KeyName
)
@Azure.ResourceManager.Private.validateCommonTypesVersionForResource(
  "v5",
  "NetworkSecurityPerimeterConfiguration"
)
@Http.Private.includeInapplicableMetadataInPayload(false)
model NspConfigurationResource<
  KeyName extends valueof string,
  Description extends valueof string = "A network security perimeter configuration resource."
> is NetworkSecurityPerimeterConfiguration;

/**
 * The name parameter for a network security perimeter configuration.
 * @template KeyName The name of the network security perimeter configuration resource name parameter.
 * @template ResourceNamePattern The regex pattern for the network security perimeter configuration resource name (default is "^[a-z][a-zA-Z0-9]*$")
 * @template MinLength The minimum length for the network security perimeter configuration resource name (default is 1)
 * @template MaxLength The maximum length for the network security perimeter configuration resource name (default is 512)
 */
@Versioning.added(Versions.v5)
@Http.Private.includeInapplicableMetadataInPayload(false)
model NspConfigurationNameParameter<
  KeyName extends valueof string = "networkSecurityPerimeterConfigurationName",
  ResourceNamePattern extends valueof string = string(""),
  MinLength extends valueof int32 = 1,
  MaxLength extends valueof int32 = 512
> {
  /** The name for a network security perimeter configuration */
  @path
  @segment("networkSecurityPerimeterConfigurations")
  @key(KeyName)
  @minLength(MinLength)
  @maxLength(MaxLength)
  @pattern(ResourceNamePattern)
  networkSecurityPerimeterConfigurationName: string;
}

/**
 * Operations over network security perimeter resources.
 * @template NspConfigurationResourceModel The type of the network security perimeter configuration resource. You must declare a network security perimeter configuration resource type in your provider namespace.
 * @template NspConfigurationKeyName Optional. The NSP configuration resource name parameter. By default, this is \`networkSecurityPerimeterConfigurationName\`.
 * @template ResourceName Optional. The name of the network security perimeter configuration resource in this context, by default, this is \`{targetResourceName}NetworkSecurityPerimeterConfiguration\`.
 * @template ResourceParameter Optional. The name parameter model for the network security perimeter configuration resource. By default, this is \`NspConfigurationNameParameter\`, which has a required path parameter for the network security perimeter configuration resource name. You can use this template parameter to specify a different parameter type if needed, but it must include at least a path parameter for the network security perimeter configuration resource name.
 *
 * @example
 * \`\`\`ts
 * namespace Microsoft.Contoso;
 * model NspConfiguration is NspConfigurationResource {}
 * alias EmployeeNspConfigurationOps is NspConfigurations<NspConfiguration>;
 * @armResourceOperations
 * interface Employees {
 *  @doc("get a network security perimeter configuration for resource employee")
 *  getNspConfiguration is EmployeeNspConfigurationOps.Read<Employee>;
 * }
 * \`\`\`
 */
@Versioning.added(Versions.v5)
interface NspConfigurationOperations<
  NspConfigurationResourceModel extends NetworkSecurityPerimeterConfiguration,
  NspConfigurationKeyName extends valueof string = "networkSecurityPerimeterConfigurationName",
  ResourceName extends valueof string = string(""),
  ResourceParameter extends {} = NspConfigurationNameParameter<NspConfigurationKeyName>
> {
  /**
   * @dev List the network security perimeter configurations to a resource
   * @template ParentResource the parent resource of the NspConfiguration
   * @template Resource Optional. The NspConfiguration resource being listed
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template ParentName Optional. The name of the parent resource
   * @template ParentFriendlyName Optional. The friendly name of the parent resource
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the list operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the network security perimeter configuration resource being operated on.
   */
  @Versioning.added(Versions.v5)
  @doc("List {name} NetworkSecurityPerimeterConfigurations", ParentResource)
  @get
  @autoRoute
  @list
  @listsResource(Resource)
  @segmentOf(ResourceParameter)
  @builtInResourceOperation(ParentResource, Resource, "list", OverrideResourceName)
  @Azure.ResourceManager.Private.enforceConstraint(ParentResource, Foundations.Resource)
  ListByParent<
    ParentResource extends Foundations.SimpleResource,
    Resource extends NetworkSecurityPerimeterConfiguration = NspConfigurationResourceModel,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmReadOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> & Parameters,
    Response,
    Error
  >;

  /**
   * @dev List the network security parameter configuration for a resource without pagination - this should only be used for legacy operations
   * @template ParentResource the parent resource of the NspConfiguration
   * @template Resource Optional. The NspConfiguration resource being listed
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template ParentName Optional. The name of the parent resource
   * @template ParentFriendlyName Optional. The friendly name of the parent resource
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the list operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the network security perimeter configuration resource being operated on.
   */
  @Versioning.added(Versions.v5)
  @Azure.ResourceManager.Private.legacyType
  @doc("List {name} NetworkSecurityPerimeterConfigurations", ParentResource)
  @get
  @autoRoute
  @listsResource(Resource)
  @segmentOf(ResourceParameter)
  @builtInResourceOperation(ParentResource, Resource, "list", OverrideResourceName)
  @Azure.ResourceManager.Private.enforceConstraint(ParentResource, Foundations.Resource)
  ListSinglePageByParent<
    ParentResource extends Foundations.SimpleResource,
    Resource extends NetworkSecurityPerimeterConfiguration = NspConfigurationResourceModel,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmReadOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> & Parameters,
    Response,
    Error
  >;

  /**
   * @dev GET a network security perimeter configuration for a particular resource
   * @template ParentResource the parent resource of the NspConfiguration
   * @template Resource the NspConfiguration resource being read
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template KeyName Optional. The NSP configuration resource name parameter. By default, this is \`networkSecurityPerimeterConfigurationName\`
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the read operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the network security perimeter configuration resource being operated on.
   */
  #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Metching legacy API"
  @Versioning.added(Versions.v5)
  @autoRoute
  @doc("Get a {name} NetworkSecurityPerimeterConfiguration", ParentResource)
  @get
  @builtInResourceOperation(ParentResource, Resource, "read", OverrideResourceName)
  Read<
    ParentResource extends Foundations.SimpleResource,
    Resource extends NetworkSecurityPerimeterConfiguration = NspConfigurationResourceModel,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    KeyName extends valueof string = "\${NspConfigurationKeyName}",
    Parameters extends {} = {},
    Response extends {} = ArmResponse<Resource>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmReadOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> &
      KeysOf<NspConfigurationNameParameter<KeyName>> &
      Parameters,
    Response,
    Error
  >;

  /**
   * @dev Perform an action on a network security perimeter configuration for a particular resource
   * @template ParentResource the parent resource of the NspConfiguration
   * @template Request The request body type
   * @template Response The success response for the read operation
   * @template Resource the NspConfiguration resource being read
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template KeyName Optional. The NSP configuration resource name parameter. By default, this is \`networkSecurityPerimeterConfigurationName\`
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the network security perimeter configuration resource being operated on.
   * @template OptionalRequestBody Optional. Indicates if the request body is optional.
   */
  #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Metching legacy API"
  @Versioning.added(Versions.v5)
  @autoRoute
  @Azure.ResourceManager.Private.enforceConstraint(ParentResource, Foundations.Resource)
  @post
  @returnsDoc("Azure operation completed successfully.")
  @doc("Perform an action over {name} NetworkSecurityPerimeterConfiguration", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "action", OverrideResourceName)
  Action<
    ParentResource extends Foundations.SimpleResource,
    Request,
    Response,
    Resource extends NetworkSecurityPerimeterConfiguration = NspConfigurationResourceModel,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    KeyName extends valueof string = "\${NspConfigurationKeyName}",
    Parameters extends TypeSpec.Reflection.Model = {},
    Error extends TypeSpec.Reflection.Model = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}",
    OptionalRequestBody extends valueof boolean = false
  >(
    ...ResourceInstanceParameters<ParentResource, BaseParameters>,
    ...KeysOf<NspConfigurationNameParameter<KeyName>>,
    ...Parameters,

    @doc("The content of the action request")
    @armBodyRoot(OptionalRequestBody)
    body: Request,
  ): Response | Error;

  /**
   * @dev Perform an action on a network security perimeter configuration for a particular resource
   * @template ParentResource the parent resource of the NspConfiguration
   * @template Request The request body type
   * @template Response The success response for the read operation
   * @template Resource the NspConfiguration resource being read
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template KeyName Optional. The NSP configuration resource name parameter. By default, this is \`networkSecurityPerimeterConfigurationName\`
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template LroHeaders Optional. The LRO headers for the accepted response
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the network security perimeter configuration resource being operated on.
   * @template OptionalRequestBody Optional. Indicates if the request body is optional.
   */
  #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "Metching legacy API"
  @Versioning.added(Versions.v5)
  @autoRoute
  @Azure.ResourceManager.Private.enforceConstraint(ParentResource, Foundations.Resource)
  @post
  @returnsDoc("Azure operation completed successfully.")
  @doc("Perform an action over {name} NetworkSecurityPerimeterConfiguration", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "action", OverrideResourceName)
  ActionAsync<
    ParentResource extends Foundations.SimpleResource,
    Request extends TypeSpec.Reflection.Model,
    Response extends TypeSpec.Reflection.Model,
    Resource extends NetworkSecurityPerimeterConfiguration = NspConfigurationResourceModel,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    KeyName extends valueof string = "\${NspConfigurationKeyName}",
    Parameters extends {} = {},
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
      Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
      Response,
      string
    > &
      Azure.Core.Foundations.RetryAfterHeader,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}",
    OptionalRequestBody extends valueof boolean = false
  >(
    ...ResourceInstanceParameters<ParentResource, BaseParameters>,
    ...KeysOf<NspConfigurationNameParameter<KeyName>>,
    ...Parameters,

    @doc("The content of the action request")
    @armBodyRoot(OptionalRequestBody)
    body: Request,
  ): ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders> | Response | Error;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/decorators.tsp":`using Reflection;

namespace Azure.ResourceManager;

/**
 * \`@armProviderNamespace\` sets the Azure Resource Manager provider name. It will default to use the
 * Namespace element value unless an override value is specified.
 *
 * @example
 *
 * \`\`\`typespec
 * @armProviderNamespace
 *  namespace Microsoft.Contoso;
 * \`\`\`
 *
 * \`\`\`typespec
 * @armProviderNamespace("Microsoft.Contoso")
 *  namespace Microsoft.ContosoService;
 * \`\`\`
 *
 * @param providerNamespace Provider namespace
 * @param libraryNamespaces a library namespace containing types for this namespace
 *
 */
extern dec armProviderNamespace(target: Namespace, providerNamespace?: valueof string);

/**
 * Declare the Azure Resource Manager library namespaces used in this provider.
 * This allows sharing Azure Resource Manager resource types across specifications
 * @param namespaces The namespaces of Azure Resource Manager libraries used in this provider
 */
extern dec useLibraryNamespace(target: Namespace, ...namespaces: Namespace[]);

/**
 * \`@armLibraryNamespace\` designates a namespace as containign Azure Resource Manager Provider information.
 *
 * @example
 *
 * \`\`\`typespec
 * @armLibraryNamespace
 *  namespace Microsoft.Contoso;
 * \`\`\`
 *
 */
extern dec armLibraryNamespace(target: Namespace);

/**
 * \`@singleton\` marks an Azure Resource Manager resource model as a singleton resource.
 *
 * Singleton resources only have a single instance with a fixed key name.
 *  \`.../providers/Microsoft.Contoso/monthlyReports/default\`
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 *
 * @param keyValue The name of the singleton resource. Default name is "default".
 */
extern dec singleton(target: Model, keyValue?: valueof string | "default");

/**
 * \`@tenantResource\` marks an Azure Resource Manager resource model as a Tenant resource/Root resource/Top-Level resource.
 *
 * Tenant resources have REST API paths like:
 *   \`/provider/Microsoft.Contoso/FooResources\`
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 */
extern dec tenantResource(target: Model);

/**
 * \`@subscriptionResource\` marks an Azure Resource Manager resource model as a subscription resource.
 *
 * Subscription resources have REST API paths like:
 *  \`/subscription/{id}/providers/Microsoft.Contoso/employees\`
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 */
extern dec subscriptionResource(target: Model);

/**
 * \`@locationResource\` marks an Azure Resource Manager resource model as a location based resource.
 *
 * **Deprecated**: This decorator is deprecated. Use \`@parentResource\` with \`ArmLocationResource\` instead.
 * See the [Location Resource sample](https://azure.github.io/typespec-azure/docs/samples/resource-manager/resource-types/location/)
 * for the recommended approach.
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 */
extern dec locationResource(target: Model);

/**
 * \`@resourceGroupResource\` marks an Azure Resource Manager resource model as a resource group level resource.
 * This is the default option for Azure Resource Manager resources. It is provided for symmetry and clarity, and
 * you typically do not need to specify it.
 *
 *   \`/subscription/{id}/resourcegroups/{rg}/providers/Microsoft.Contoso/employees\`
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 */
extern dec resourceGroupResource(target: Model);

/**
 * \`@extensionResource\` marks an Azure Resource Manager resource model as an Extension resource.
 * Extension resource extends other resource types. URL path is appended
 * to another segment {scope} which refers to another Resource URL.
 *
 *   \`{resourceUri}/providers/Microsoft.Contoso/accessPermissions\`
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 */
extern dec extensionResource(target: Model);

/**
 * \`@armResourceType\` sets the value fo the decorated string
 * property to the type of the Azure Resource Manager resource.
 * @param resource The resource to get the type of
 */
extern dec armProviderNameValue(target: Operation);

/**
 * Marks the operation as being a collection action
 */
extern dec armResourceCollectionAction(target: Operation);

/**
 * @param resourceModel Resource model
 * @param resourceName Optional. The name of the resource. If not provided, the name of the resource model will be used.
 */
extern dec armResourceAction(
  target: Operation,
  resourceModel: Model,
  resourceName?: valueof string
);

/**
 * @param resourceModel Resource model
 * @param resourceName Optional. The name of the resource. If not provided, the name of the resource model will be used.
 */
extern dec armResourceCreateOrUpdate(
  target: Operation,
  resourceModel: Model,
  resourceName?: valueof string
);

/**
 * @param resourceModel Resource model
 * @param resourceName Optional. The name of the resource. If not provided, the name of the resource model will be used.
 */
extern dec armResourceRead(target: Operation, resourceModel: Model, resourceName?: valueof string);

/**
 * @param resourceModel Resource model
 * @param resourceName Optional. The name of the resource. If not provided, the name of the resource model will be used.
 */
extern dec armResourceUpdate(
  target: Operation,
  resourceModel: Model,
  resourceName?: valueof string
);

/**
 * @param resourceModel Resource model
 * @param resourceName Optional. The name of the resource. If not provided, the name of the resource model will be used.
 */
extern dec armResourceDelete(
  target: Operation,
  resourceModel: Model,
  resourceName?: valueof string
);

/**
 * @param resourceModel Resource model
 * @param resourceName Optional. The name of the resource. If not provided, the name of the resource model will be used.
 */
extern dec armResourceList(target: Operation, resourceModel: Model, resourceName?: valueof string);

/**
 * Marks the operation as being a check existence (HEAD) operation
 * @param resourceModel Resource model
 * @param resourceName Optional. The name of the resource. If not provided, the name of the resource model will be used.
 */
extern dec armResourceCheckExistence(
  target: Operation,
  resourceModel: Model,
  resourceName?: valueof string
);

/**
 * This decorator is used to identify interfaces containing resource operations.
 * By default, it marks the interface with the \`@autoRoute\` decorator so that
 * all of its contained operations will have their routes generated
 * automatically.
 *
 * The decorator also adds a \`@tag\` decorator bearing the name of the interface so that all
 * of the operations will be grouped based on the interface name in generated
 * clients.
 *
 * The optional \`resourceOperationOptions\` parameter provides additional options.
 * \`allowStaticRoutes\` turns off autoRout for the interface, so individual operations can
 * choose static (\`@route\`) or automatic (\`@autoRoute\`) routing.
 *
 * \`resourceType: Model\` specifies the resource type for the operations in the interface
 *
 * \`omitTags: true\`: turns off the default tagging of operations in the interface, so that individual operations must be
 * individually tagged
 *
 *
 * @param resourceOperationOptions Options for routing the operations in the interface and associating them with a specific resource
 */
extern dec armResourceOperations(
  target: Interface,
  resourceOperationOptions?: (valueof ResourceOperationOptions) | unknown
);

/** Interface-level operation options */
model ResourceOperationOptions {
  /**
   * The resource type for the operations in the interface
   */
  resourceType?: Model;

  /**
   * If true, turns off autoRoute for the interface, so individual operations can choose static (\`@route\`) or automatic (\`@autoRoute\`) routing.
   */
  allowStaticRoutes?: boolean;

  /**
   * If true, turns off the default tagging of operations in the interface, so that individual operations must be individually tagged
   */
  omitTags?: boolean;
}

/**
 * This decorator is used either on a namespace or a version enum value to indicate
 * the version of the Azure Resource Manager common-types to use for refs in emitted Swagger files.
 *
 * @param version The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value like "v5".
 */
extern dec armCommonTypesVersion(
  target: Namespace | EnumMember,
  version: valueof string | EnumMember
);

/**
 * This decorator is used on Azure Resource Manager resources that are not based on
 * Azure.ResourceManager common types.
 *
 * @param propertiesType: The type of the resource properties.
 * @param provider Optional. The resource provider namespace for the virtual resource.
 */
extern dec armVirtualResource(target: Model, provider?: valueof string);

/**
 * This decorator sets the base type of the given resource.
 *
 * @param baseTypeIt The built-in parent of the resource, this can be "Tenant", "Subscription", "ResourceGroup", "Location", or "Extension"
 */
extern dec resourceBaseType(
  target: Model,
  baseTypeIt: "Tenant" | "Subscription" | "ResourceGroup" | "Location" | "Extension"
);

/**
 * This decorator is used to indicate the identifying properties of objects in the array, e.g. size
 * The properties that are used as identifiers for the object needs to be provided as a list of strings.
 *
 * @param properties The list of properties that are used as identifiers for the object. This needs to be provided as a list of strings.
 *
 * @example
 * \`\`\`typespec
 * model Pet {
 *  @identifiers(#["size"])
 *  dog: Dog;
 * }
 * \`\`\`
 */
extern dec identifiers(entity: ModelProperty | Array<unknown>, properties: valueof string[]);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/responses.tsp":`using Http;
using Rest;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;
using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager;

/**
 * The Azure Resource Manager synchronous OK response
 * @template ResponseBody The contents of the response body
 *
 * @example
 * \`\`\`typespec
 *  op get is ArmResourceRead<Employee, Response = ArmResponse<Employee>>;
 * \`\`\`
 */
@doc("Azure operation completed successfully.")
model ArmResponse<ResponseBody> {
  ...OkResponse;

  @doc("The body type of the operation request or response.")
  @bodyRoot
  body: ResponseBody;
}

/**
 * The Azure Resource Manager 201 response for a resource
 * @template ResponseBody The contents of the response body
 * @template ExtraHeaders Additional headers in the response. Default includes Retry-After header
 *
 * @example
 * \`\`\`typespec
 * @post
 * op post(...ResourceInstanceParameters<Employee>): ArmCreatedResponse<
 *   Employee,
 *   ExtraHeaders = {@header("x-ms-client-request-id") clientRequestId: string}
 * >;
 * \`\`\`
 */
@doc("Azure create operation completed successfully.")
model ArmCreatedResponse<
  ResponseBody,
  ExtraHeaders extends TypeSpec.Reflection.Model = Azure.Core.Foundations.RetryAfterHeader
> {
  ...CreatedResponse;
  ...ExtraHeaders;
  ...Body<ResponseBody>;
}

/**
 * The response for synchronous delete of a resource
 *
 * @example
 * \`\`\`typespec
 *  @delete
 *  @armResourceDelete(Employee)
 * op delete(
 *    ...ResourceInstanceParameters<Employee>,
 *  ): ArmDeletedResponse | ArmDeletedNoContentResponse | ErrorResponse;
 * \`\`\`
 */
@doc("Resource deleted successfully.")
model ArmDeletedResponse {
  ...OkResponse;
}

/**
 * @dev The response for asynchronous Azure Resource Manager delete ACCEPTED
 * @template LroHeaders Optional.  Allows overriding the Lro headers returned in the response.
 *
 * @example
 * \`\`\`typespec
 * op delete is ArmResourceDeleteWithoutOkAsync<
 *  Employee,
 *  Response = ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
 *>;
 * \`\`\`
 */
model ArmDeleteAcceptedLroResponse<LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
  Azure.Core.Foundations.RetryAfterHeader>
  is ArmAcceptedLroResponse<"Resource deletion accepted.", LroHeaders>;

/**
 * @dev The response for synchronous Azure Resource Manager delete ACCEPTED
 */
model ArmDeleteAcceptedResponse is ArmAcceptedResponse<"Resource deletion accepted.">;

/**
 * @dev The standard ACCEPTED response
 * @template Message The description of the response status (defaults to \`Resource operation accepted\`)
 * @template ExtraHeaders Additional headers in the response. Default includes Retry-After header
 *
 * @example
 * \`\`\`typespec
 * op post is ArmProviderActionSync<
 *  Request = Employee,
 *  Response = ArmAcceptedResponse<ExtraHeaders = ArmLroLocationHeader>,
 *  Scope = SubscriptionActionScope
 * >;
 * \`\`\`
 */
@doc(Message)
model ArmAcceptedResponse<
  Message extends valueof string = "Resource operation accepted.",
  ExtraHeaders extends TypeSpec.Reflection.Model = Azure.Core.Foundations.RetryAfterHeader
> {
  ...AcceptedResponse;
  ...ExtraHeaders;
}

/**
 * @dev The standard Azure Resource Manager response for asynchronous PATCH, POST, and DELETE operations
 * @template Description The description of the response status (defaults to \`Resource operation accepted\`)
 * @template LroHeaders Optional.  The lro headers that appear in the Accepted response
 *
 * @example
 * \`\`\`typespec
 * @post
 * op post(
 *  ...ResourceInstanceParameters<Employee>,
 * ): ArmAcceptedLroResponse<
 *    LroHeaders = ArmLroLocationHeader<FinalResult = Employee> &
 *    Azure.Core.Foundations.RetryAfterHeader
 * > | ErrorResponse;
 * \`\`\`
 */
@doc(Description)
model ArmAcceptedLroResponse<
  Description extends valueof string = "Resource operation accepted.",
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
    Azure.Core.Foundations.RetryAfterHeader
> {
  ...AcceptedResponse;
  ...LroHeaders;
}

/**
 * Standard Azure Resource Manager operation status response, used as the response
 * body for \`GetResourceOperationStatus\`.
 *
 * @template Properties Optional resource-specific properties
 * @template StatusValues The set of allowed values for operation status
 */
model ArmOperationStatus<
  Properties extends {} = never,
  StatusValues extends TypeSpec.Reflection.Union = ResourceProvisioningState
> {
  /** RP-specific properties for the operationStatus resource, only appears when operation ended with Succeeded status */
  @visibility(Lifecycle.Read)
  properties?: Properties;

  /** The operation status */
  @Azure.Core.lroStatus
  status: StatusValues;

  /** The unique identifier for the operationStatus resource */
  id: string;

  /** The name of the operationStatus resource */
  @visibility(Lifecycle.Read)
  name?: string;

  /** Operation start time */
  @visibility(Lifecycle.Read)
  startTime?: utcDateTime;

  /** Operation complete time */
  @visibility(Lifecycle.Read)
  endTime?: utcDateTime;

  /** The progress made toward completing the operation */
  @visibility(Lifecycle.Read)
  percentComplete?: float64;

  /** Errors that occurred if the operation ended with Canceled or Failed status */
  @visibility(Lifecycle.Read)
  error?: ErrorDetail;
}

/**
 * The standard header for asynchronous operation polling
 *  @template StatusMonitor The status monitor type for lro polling
 *  @template UrlValue The value type of the Azure-AsyncOperation header
 *  @template FinalResult The logical final result of the operation
 *
 * @example
 * \`\`\`typespec
 * op changeWidget is ArmResourceActionAsync<
 *  WidgetResource,
 *  WidgetResourceRequest,
 *  WidgetResourceResponse,
 *  LroHeaders = ArmAsyncOperationHeader<FinalResult = WidgetResource>
 * >;
 * \`\`\`
 */
model ArmAsyncOperationHeader<
  StatusMonitor extends {} = ArmOperationStatus,
  UrlValue extends string = string,
  FinalResult extends TypeSpec.Reflection.Model | unknown | void = never
> {
  /** A link to the status monitor */
  @header("Azure-AsyncOperation")
  @Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<PollingModel = StatusMonitor>)
  @Azure.Core.finalLocation(FinalResult)
  azureAsyncOperation?: UrlValue;
}

/**
 * The default header for lro PUT and DELETE polling
 * @template LroPollingOptions The polling options when polling the url in the location header
 * @template FinalResult The ultimate final result of the logical operation
 * @template UrlValue The value type for the location header
 * 
 * @example
 * \`\`\`typespec
 * op update is ArmResourceActionAsync<
 *  Employee,
 *  Employee,
 *  OkResponse,
 *  LroHeaders = ArmLroLocationHeader<
 *    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
 *    Employee
 *  >
  >;
 * \`\`\`
 */
model ArmLroLocationHeader<
  LroPollingOptions extends Azure.Core.PollingOptions = Azure.Core.StatusMonitorPollingOptions<PollingModel = ArmOperationStatus>,
  FinalResult extends TypeSpec.Reflection.Model | unknown | void = void,
  UrlValue extends string = string
> {
  /** The Location header contains the URL where the status of the long running operation can be checked. */
  @header("Location")
  @Azure.Core.pollingLocation(LroPollingOptions)
  @Azure.Core.finalLocation(FinalResult)
  location?: UrlValue;
}

/**
 * Provide Both Azure-AsyncOperation and Location headers
 * @template StatusMonitor The type of the polling StatusMonitor when following the Azure-AsyncOperation url
 * @template FinalResult The type of the logical result when following the location header
 * @template PollingUrlValue The value type of the link to the status monitor
 * @template FinalUrlValue The value type fo the link to the final result
 *
 * @example
 * \`\`\`typespec
 *  op delete is ArmResourceDeleteWithoutOkAsync<
 *    Employee,
 *    LroHeaders = ArmCombinedLroHeaders<ArmOperationStatus, Employee>
 *  >;
 * \`\`\`
 */
model ArmCombinedLroHeaders<
  StatusMonitor extends {} = ArmOperationStatus,
  FinalResult extends TypeSpec.Reflection.Model | unknown | void = void,
  PollingUrlValue extends string = ResourceLocation<StatusMonitor>,
  FinalUrlValue extends string = string
> {
  /** A link to the status monitor */
  @Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<StatusMonitor>)
  @header("Azure-AsyncOperation")
  azureAsyncOperation?: PollingUrlValue;

  /** The Location header contains the URL where the status of the long running operation can be checked. */
  @header("Location")
  @Azure.Core.finalLocation(FinalResult)
  location?: FinalUrlValue;
}

/**
 * @dev Azure Resource Manager response for a properly formed delete request, with no resource found
 *
 * @example
 * \`\`\`typespec
 * op delete is ArmResourceDeleteWithoutOkAsync<
 *  Employee,
 *  Response = ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
 * >;
 * \`\`\`
 */
model ArmDeletedNoContentResponse is ArmNoContentResponse<"Resource does not exist.">;

/**
 * Standard Azure Resource Manager NoContent (204) response
 * @template Message The description of the response status (defaults to \`Operation completed successfully\`)
 *
 * @example
 * \`\`\`typespec
 * @delete
 * op delete(@path id:string): ArmNoContentResponse;
 * \`\`\`
 */
@doc(Message)
model ArmNoContentResponse<Message extends valueof string = "Operation completed successfully."> {
  ...NoContentResponse;
}

/**
 * @dev Resource update operation succeeded
 * @template Resource The resource being updated
 *
 * @example
 * \`\`\`typespec
 * @put
 * op update(
 *  ...ResourceInstanceParameters<Employee>,
 * ): ArmResourceUpdatedResponse<Employee>;
 * \`\`\`
 */
@doc("Resource '{name}' update operation succeeded", Resource)
model ArmResourceUpdatedResponse<Resource extends Azure.ResourceManager.Foundations.SimpleResource>
  is ArmResponse<Resource>;

/**
 * @dev Resource create operation succeeded
 * @template Resource The resource being updated
 * @template LroHeaders Optional. The lro headers returned with a Created response
 *
 * @example
 * \`\`\`typespec
 * op createOrUpdate is ArmResourceCreateOrReplaceAsync<
 *   Employee,
 *   Response = ArmResponse<Employee> | ArmResourceCreatedResponse<
 *     Employee,
 *     LroHeaders = ArmLroLocationHeader<FinalResult = Employee> & Azure.Core.Foundations.RetryAfterHeader
 *   >
 * >;
 * \`\`\`
 */
@doc("Resource '{name}' create operation succeeded", Resource)
model ArmResourceCreatedResponse<
  Resource extends Azure.ResourceManager.Foundations.SimpleResource,
  LroHeaders extends TypeSpec.Reflection.Model = Azure.Core.Foundations.RetryAfterHeader
> {
  ...CreatedResponse;
  ...LroHeaders;

  @Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<Resource>)
  @doc("The resource body")
  @bodyRoot
  body: Resource;
}

/**
 * @dev Resource synchronous create operation succeeded
 * @template Resource The resource being updated
 *
 * @example
 * \`\`\`typespec
 * op createOrUpdate is ArmResourceCreateOrReplaceSync<
 *  Employee,
 *  Response = ArmResponse<Employee> | ArmResourceCreatedSyncResponse<Employee>
 * >;
 * \`\`\`
 */
@doc("Resource '{name}' create operation succeeded", Resource)
model ArmResourceCreatedSyncResponse<Resource extends Azure.ResourceManager.Foundations.SimpleResource> {
  ...CreatedResponse;

  @doc("The body type of the operation request or response.")
  @bodyRoot
  body: Resource;
}

/**
 * @dev Resource exists response
 *
 * @example
 * \`\`\`typespec
 * @head
 * op head(...ResourceInstanceParameters<Employee>): ArmResourceExistsResponse;
 * \`\`\`
 */
@doc("The Azure resource exists")
model ArmResourceExistsResponse {
  ...NoContentResponse;
}

/**
 * @dev Resource is not found response
 * \`\`\`typespec
 * @head
 * op head(...ResourceInstanceParameters<Employee>): ArmResponse<Employee>  | ArmResourceNotFoundResponse;
 * \`\`\`
 */
@doc("The Azure resource is not found")
model ArmResourceNotFoundResponse {
  ...NotFoundResponse;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/parameters.tsp":`using Http;
using Rest;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;
using Azure.ResourceManager.CommonTypes;
using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager;

/**
 * The default api-version parameter type.
 */
alias ApiVersionParameter = CommonTypes.ApiVersionParameter;

/**
 * The default subscriptionId parameter type.
 */
alias SubscriptionIdParameter = CommonTypes.SubscriptionIdParameter;

/**
 * The default ResourceGroup parameter type.
 */
alias ResourceGroupParameter = CommonTypes.ResourceGroupNameParameter;

/**
 * DEPRECATED - DO NOT USE
 * The default location parameter type.
 */
@doc("The default location parameter type.")
model LocationParameter {
  @path
  @minLength(1)
  @segment("locations")
  @doc("The location name.")
  @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v3)
  @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v4)
  @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v5)
  @resourceParameterBaseFor([ResourceHome.Location])
  location: string;
}

/** The default location parameter type. */
model LocationResourceParameter {
  /** The name of the Azure region. */
  @path
  @minLength(1)
  @segment("locations")
  @key
  location: Azure.Core.azureLocation;
}

/**
 * The location resource for tenant-based locations.  This can be used as a parent
 * resource for resource types that are homed in a tenant-based location.
 *
 * @example
 * \`\`\`typespec
 * @parentResource(TenantLocationResource)
 * model Employee is TrackedResource<EmployeeProperties> {
 *  ...ResourceNameParameter<Employee>
 * }
 * \`\`\`
 */
model TenantLocationResource is ArmLocationResource<"Tenant">;

/**
 * The location resource for subscription-based locations.  This can be used as a parent
 * resource for resource types that are homed in a subscription-based location.
 *
 * @example
 * \`\`\`typespec
 * @parentResource(SubscriptionLocationResource)
 * model Employee is TrackedResource<EmployeeProperties> {
 *  ...ResourceNameParameter<Employee>;
 * }
 * \`\`\`
 */
model SubscriptionLocationResource is ArmLocationResource<"Subscription">;

/**
 * The location resource for resourceGroup-based locations.  This can be used as a parent
 * resource for resource types that are homed in a resourceGroup-based location.
 */
model ResourceGroupLocationResource is ArmLocationResource<"ResourceGroup">;

/**
 * Template for ARM location resources.  Use the parameter to specify
 * the parent of the location resource.
 * @template BaseType The parent of the location, one of "Subscription", "Tenant", "ResourceGroup", or "Extension".
 *
 * @example
 * \`\`\`typespec
 * @parentResource(ArmLocationResource<"ResourceGroup">)
 * model Employee is TrackedResource<EmployeeProperties> {
 *  ...ResourceNameParameter<Employee>;
 * }
 * \`\`\`
 */
@friendlyName("Location")
@armVirtualResource
@resourceBaseType(BaseType)
model ArmLocationResource<BaseType extends
  | "Tenant"
  | "Subscription"
  | "ResourceGroup"
  | "Location"
  | "Extension" = never> {
  ...LocationResourceParameter;
}

/**
 * The default resourceUri parameter type.
 *
 * @example
 * \`\`\`typespec
 * model Employee {
 *  ...ResourceUriParameter;
 * }
 * \`\`\`
 */
@doc("The default resourceUri parameter type.")
model ResourceUriParameter {
  @path(#{ allowReserved: true })
  @doc("The fully qualified Azure Resource manager identifier of the resource.")
  @resourceParameterBaseFor([ResourceHome.Extension])
  resourceUri: string;
}

/**
 * The dynamic parameters of a resource instance - pass in the proper base type to indicate
 * where the resource is based.  The default is in a resource group
 * @template Resource The resource to get parameters for
 * @template BaseParameters The parameters representing the base Uri of the resource
 * @template Provider Optional. The provider namespace model for the resource.
 *
 * @example
 * \`\`\`typespec
 * op get(
 *  ...ResourceInstanceParameters<Employee>,
 * ): ArmResponse<EmployeeResponse> | ErrorResponse;
 * \`\`\`
 */
model ResourceInstanceParameters<
  Resource extends {},
  BaseParameters = DefaultBaseParameters<Resource>,
  Provider extends {} = ProviderNamespace<Resource>
> {
  ...BaseParameters;
  ...Provider;
  ...KeysOf<Resource>;
}

/**
 * The dynamic parameters of a list call for a resource instance - pass in the proper base type to indicate
 * where the list should take place.  The default is in a resource group
 * @template Resource The resource to get parameters for
 * @template BaseParameters The parameters representing the base Uri of the resource
 * @template Provider Optional. The provider namespace model for the resource.
 */
model ResourceParentParameters<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  Provider extends {} = ProviderNamespace<Resource>
> {
  ...BaseParameters;
  ...Provider;
  ...ParentKeysOf<Resource>;
}

/**
 * The dynamic parameters of a list call for an extension resource instance.
 * @template Resource The extension resource
 */
alias ExtensionResourceInstanceParameters<Resource extends Foundations.SimpleResource> = ResourceInstanceParameters<
  Resource,
  ExtensionBaseParameters
>;

/**
 * The dynamic parameters of a list call for a tenant resource instance.
 * @template Resource the tenant resource
 */
alias TenantInstanceParameters<Resource extends Foundations.SimpleResource> = ResourceInstanceParameters<
  Resource,
  TenantBaseParameters
>;

/**
 * Template used by ArmProviderAction templates.
 *
 * @example
 * \`\`\`typespec
 * op action is ArmProviderActionSync<Response = Employee, Scope = SubscriptionActionScope>;
 * \`\`\`
 */
@armVirtualResource
@subscriptionResource
model SubscriptionActionScope {
  @doc("Symbolic name of scope")
  @path
  @visibility(Lifecycle.Read)
  @key
  @segment("subscription")
  name: string;
}

/**
 * Template used by ArmTenantAction templates.
 *
 *  @example
 * \`\`\`typespec
 * op action is ArmProviderActionSync<Response = Employee, Scope = TenantActionScope>;
 * \`\`\`
 */
@armVirtualResource
@tenantResource
model TenantActionScope {
  @doc("Symbolic name of scope")
  @path
  @visibility(Lifecycle.Read)
  @key
  @segment("tenant")
  name: string;
}

/**
 * Scope for operation status endpoints at the tenant level with a location path segment.
 * Use with \`GetResourceOperationStatus\` to produce:
 * \`GET /providers/{providerNamespace}/locations/{location}/operationStatuses/{operationId}\`
 *
 * @example
 * \`\`\`typespec
 * op getStatus is GetResourceOperationStatus<ArmOperationStatus, TenantLocationActionScope>;
 * \`\`\`
 */
@armVirtualResource
@tenantResource
model TenantLocationActionScope {
  ...LocationResourceParameter;
}

/**
 * Scope for operation status endpoints at the subscription level with a location path segment.
 * Use with \`GetResourceOperationStatus\` to produce:
 * \`GET /subscriptions/{subscriptionId}/providers/{providerNamespace}/locations/{location}/operationStatuses/{operationId}\`
 *
 * @example
 * \`\`\`typespec
 * op getStatus is GetResourceOperationStatus<ArmOperationStatus, SubscriptionLocationActionScope>;
 * \`\`\`
 */
@armVirtualResource
@subscriptionResource
model SubscriptionLocationActionScope {
  ...LocationResourceParameter;
}

/**
 * Template used by ArmProviderAction templates. This produces following action route:
 * \`/{resourceUri}/providers/Microsoft.SomeRP/someAction\`
 */
@armVirtualResource
@extensionResource
model ExtensionResourceActionScope {
  @doc("Symbolic name of scope")
  @path
  @visibility(Lifecycle.Read)
  @key
  @segment("extensionresource")
  name: string;
}

/**
 * Template used by ArmProviderAction templates. This produces following action route:
 * \`/{scope}/providers/Microsoft.SomeRP/someAction\`
 * @template StringType The type of the scope name parameter, defaults to string.
 */
model ExtensionActionScope<StringType extends string = string>
  is Extension.ScopeParameter<StringType>;

/**
 * Standard list parameter $top, allows the user to control the total number of returned items.
 */
model ArmTopParameter {
  @query("$top")
  @doc("The total number of items to return.")
  top: int64;
}

/**
 * Standard list parameter $filter, allows the user to filter the results of a list operation.
 */
model ArmFilterParameter {
  @query("$filter")
  @doc("The OData filter expression to apply to the list operation.")
  filter: string;
}

/**
 * List parameter $skip, allows the user to control the offset of returned items.
 */
model ArmSkipParameter {
  @query("$skip")
  @doc("The number of items to skip before starting to collect the result set.")
  skip: int64;
}

/**
 * Standard list parameter $skiptoken, normally returned in the \`nextLink\` url of a page of items
 */
model SkipTokenParameter {
  @query("$skiptoken")
  @doc("An opaque value to use for pagination.")
  skipToken: string;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/arm.legacy.tsp":`import "./managed-identity.tsp";
import "./legacy.decorators.tsp";
import "./operations.tsp";
import "./interfaces.tsp";
import "./extension.tsp";
import "./extension-operations.tsp";
import "./private-endpoints.tsp";
import "./resource.tsp";

namespace Azure.ResourceManager.Legacy;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/managed-identity.tsp":`import "@azure-tools/typespec-azure-core";
import "../common-types/common-types.tsp";

using Azure.Core;
using Azure.ResourceManager.CommonTypes.Private;

namespace Azure.ResourceManager.Legacy;

/**
 * Model representing the standard \`ManagedServiceIdentity\` envelope property from V4 of common type.
 *
 * Please note that this is only included for legacy specs with mixed v3 and v4 types, which would cause
 * breaking changes due to the ManagedServiceIdentityType.SystemAndUserAssigned value changes.
 *
 * Do not use this if you are already on CommonTypes.Version.v4 or beyond.
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   ...ResourceNameParameter<Foo>;
 *   ...Legacy.ManagedServiceIdentityV4Property;
 * }
 * \`\`\`
 */
@doc("The managed service identities envelope.")
model ManagedServiceIdentityV4Property {
  @doc("The managed service identities assigned to this resource.")
  identity?: ManagedServiceIdentityV4;
}

/**
 * Managed service identity (system assigned and/or user assigned identities)
 */
#suppress "@azure-tools/typespec-azure-resource-manager/arm-common-types-incompatible-version" "intended only for v3/v4 mix backcompat cases"
@armCommonDefinition(
  "ManagedServiceIdentity",
  #{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true },
  "managedidentity.json"
)
model ManagedServiceIdentityV4 {
  /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */
  @visibility(Lifecycle.Read)
  principalId?: uuid;

  /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */
  @visibility(Lifecycle.Read)
  tenantId?: uuid;

  /** The type of managed identity assigned to this resource. */
  type: ManagedServiceIdentityType;

  /** The identities assigned to this resource by the user. */
  userAssignedIdentities?: Record<Azure.ResourceManager.CommonTypes.UserAssignedIdentity>;
}

/**
 * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
 */
union ManagedServiceIdentityType {
  /** No managed identity. */
  None: "None",

  /** System assigned managed identity. */
  SystemAssigned: "SystemAssigned",

  /** User assigned managed identity. */
  UserAssigned: "UserAssigned",

  /** System and user assigned managed identity. */
  SystemAndUserAssigned: "SystemAssigned, UserAssigned",

  string,
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/legacy.decorators.tsp":`using Reflection;

namespace Azure.ResourceManager.Legacy;

/**
 * Route options for an operation
 */
model ArmOperationOptions {
  /** Should a static route be used */
  useStaticRoute?: boolean;

  /** The status route for operations to use */
  route?: string;
}

/** Options for customizing the behavior of a custom azure resource */
model CustomResourceOptions {
  /** Should the resource be marked as an Azure resource */
  isAzureResource?: boolean;
}

/**
 * This decorator is used on resources that do not satisfy the definition of a resource
 * but need to be identified as such.
 * @param options Options for customizing the behavior of the resource
 */
extern dec customAzureResource(target: Model, options?: valueof CustomResourceOptions);

/**
 * Specify an external reference that should be used when emitting this type.
 * @param jsonRef - External reference(e.g. "../../common.json#/definitions/Foo")
 */
extern dec externalTypeRef(entity: Model | ModelProperty, jsonRef: valueof string);

/**
 * Signifies that an operation is an Azure Resource Manager operation
 * and optionally associates the operation with a route template.
 * @param target The operation to associate the model with
 * @param route Optional route to associate with the operation
 */
extern dec armOperationRoute(target: Operation, route?: valueof ArmOperationOptions);

/**
 * Signifies that a Resource is represented using a library type in generated SDKs.
 * @param target The model to that is an external resource
 */
extern dec armExternalType(target: Model);

/**
 * Renames a path parameter in an Azure Resource Manager operation.
 * @param target The operation or interface to modify
 * @param sourceParameterName The name of the parameter to rename
 * @param targetParameterName The new name for the parameter
 */
extern dec renamePathParameter(
  target: Operation,
  sourceParameterName: valueof string,
  targetParameterName: valueof string
);

/**
 * Options for defining a feature and the associated file
 */
model ArmFeatureOptions {
  /** The feature name */
  featureName: string;

  /** The associated file name for the features */
  fileName: string;

  /** The feature description in Swagger */
  description: string;

  /** The feature title in Swagger */
  title?: string;

  /** The feature terms of service in Swagger */
  termsOfService?: string;
}

/**
 * Decorator to define a set of features
 * @param target The service namespace
 * @param features The enum that contains the features
 */
extern dec features(target: Namespace, features: Enum);

/**
 * Decorator to define options for a specific feature
 * @param target The enum member that represents the feature
 * @param options The options for the feature
 */
extern dec featureOptions(target: EnumMember, options: valueof ArmFeatureOptions);

/**
 * Decorator to associate a feature with a model, interface, or namespace
 * @param target The target to associate the feature with
 * @param featureName The feature to associate with the target
 */
extern dec feature(target: Model | Operation | Interface | Namespace, featureName: EnumMember);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/operations.tsp":`import "@typespec/rest";
import "@typespec/http";

namespace Azure.ResourceManager.Legacy;

using Http;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;
using Rest;

/**
 * An operation template used to build resource operations in which the same resource type
 * is accessible at multiple, fixed resource paths.
 * @template ParentParameters The path parameters for the resource parent
 * @template ResourceTypeParameter The path parameter for the resource name
 * @template ErrorType Optional. The type of error models used in operations created form this template
 * @template ResourceName Optional. The name of the resource type described in this template
 */
interface LegacyOperations<
  ParentParameters extends {},
  ResourceTypeParameter extends {},
  ErrorType extends {} = ErrorResponse,
  ResourceName extends valueof string = string("")
>
  extends RoutedOperations<
      ParentParameters,
      ResourceTypeParameter,
      ErrorType,
      RoutedResourceName = ResourceName
    > {}

/**
 * An operation template used to build resource operations in which the same resource type
 * is accessible at multiple, fixed resource paths. Can be used with static routes.
 * @template ParentParameters The path parameters for the resource parent
 * @template ResourceTypeParameter The path parameter for the resource name
 * @template ErrorType Optional. The type of error models used in operations created form this template
 * @template ResourceRoute Optional. The resource route to use for operations in the interface.
 * @template RoutedResourceName Optional. The name of the resource type described in this template
 */
@doc("")
interface RoutedOperations<
  ParentParameters extends {},
  ResourceTypeParameter extends {},
  ErrorType extends {} = ErrorResponse,
  ResourceRoute extends valueof ArmOperationOptions = #{ useStaticRoute: false },
  RoutedResourceName extends valueof string = string("")
> {
  /**
   * A long-running resource CreateOrUpdate (PUT)
   * @template Resource the resource being created or updated
   * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the PUT operation
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template Request Optional. The request body for the createOrUpdate operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  @doc("Create a {name}", Resource)
  @armOperationRoute(OverrideRouteOptions)
  @legacyResourceOperation(Resource, "createOrUpdate", OverrideResourceName)
  @Private.armUpdateProviderNamespace
  @Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
  @put
  CreateOrUpdateAsync<
    Resource extends Foundations.SimpleResource,
    LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResourceUpdatedResponse<Resource>
      | ArmResourceCreatedResponse<Resource, LroHeaders>,
    OptionalRequestBody extends valueof boolean = false,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    Request extends {} | void = Resource,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(
    ...ParentParameters,
    ...ResourceTypeParameter,
    ...Parameters,
    @doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) resource: Request,
  ): Response | OverrideErrorType;

  /**
   * A synchronous resource CreateOrUpdate (PUT)
   * @template Resource the resource being created or updated
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the PUT operation
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template Request Optional. The request body for the createOrUpdate operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  #suppress "@azure-tools/typespec-azure-core/no-private-usage"
  @armOperationRoute(OverrideRouteOptions)
  @doc("Create a {name}", Resource)
  @legacyResourceOperation(Resource, "createOrUpdate", OverrideResourceName)
  @Private.armUpdateProviderNamespace
  @put
  CreateOrUpdateSync<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResourceUpdatedResponse<Resource>
      | ArmResourceCreatedSyncResponse<Resource>,
    OptionalRequestBody extends valueof boolean = false,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    Request extends {} | void = Resource,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(
    ...ParentParameters,
    ...ResourceTypeParameter,
    ...Parameters,
    @doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) resource: Request,
  ): Response | OverrideErrorType;

  /**
   * A long-running resource Update (PATCH)
   * @template Resource the resource being updated
   * @template PatchModel the PATCH request model
   * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the PATCH operation
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  @doc("Update a {name}", Resource)
  @armOperationRoute(OverrideRouteOptions)
  @legacyResourceOperation(Resource, "update", OverrideResourceName)
  @Private.armUpdateProviderNamespace
  @patch(#{ implicitOptionality: false })
  CustomPatchAsync<
    Resource extends Foundations.SimpleResource,
    PatchModel extends {} | void = Azure.ResourceManager.Foundations.TagsUpdateModel<Resource>,
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
      Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
      Resource,
      string
    > &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResponse<Resource>
      | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
    OptionalRequestBody extends valueof boolean = false,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(
    ...ParentParameters,
    ...ResourceTypeParameter,
    ...Parameters,
    @doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) properties: PatchModel,
  ): Response | OverrideErrorType;

  /**
   * A synchronous resource Update (PATCH)
   * @template Resource the resource being created or updated
   * @template PatchModel the PATCH request model
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the PATCH operation
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  @doc("Update a {name}", Resource)
  @armOperationRoute(OverrideRouteOptions)
  @legacyResourceOperation(Resource, "update", OverrideResourceName)
  @Private.armUpdateProviderNamespace
  @patch(#{ implicitOptionality: false })
  CustomPatchSync<
    Resource extends Foundations.SimpleResource,
    PatchModel extends {} | void = Azure.ResourceManager.Foundations.TagsUpdateModel<Resource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<Resource>,
    OptionalRequestBody extends valueof boolean = false,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(
    ...ParentParameters,
    ...ResourceTypeParameter,
    ...Parameters,
    @doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) properties: PatchModel,
  ): Response | OverrideErrorType;

  /**
   * Delete a resource asynchronously
   * @template Resource The resource being deleted
   * @template LroHeaders The lro headers for the operation
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the delete operation
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  #suppress "@azure-tools/typespec-azure-core/no-response-body" "Valid"
  @doc("Delete a {name}", Resource)
  @armOperationRoute(OverrideRouteOptions)
  @delete
  @deletesResource(Resource)
  @Private.armUpdateProviderNamespace
  @legacyResourceOperation(Resource, "delete", OverrideResourceName)
  DeleteWithoutOkAsync<
    Resource extends Foundations.SimpleResource,
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} = ArmDeleteAcceptedLroResponse<LroHeaders> | ArmDeletedNoContentResponse,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(...ParentParameters, ...ResourceTypeParameter, ...Parameters): Response | OverrideErrorType;

  /**
   * Delete a resource synchronously
   * @template Resource The resource being deleted
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the delete operation
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  #suppress "@azure-tools/typespec-azure-core/no-response-body" "Valid"
  @doc("Delete a {name}", Resource)
  @armOperationRoute(OverrideRouteOptions)
  @delete
  @deletesResource(Resource)
  @legacyResourceOperation(Resource, "delete", OverrideResourceName)
  @Private.armUpdateProviderNamespace
  DeleteSync<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmDeletedResponse | ArmDeletedNoContentResponse,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(...ParentParameters, ...ResourceTypeParameter, ...Parameters): Response | OverrideErrorType;

  /**
   * @dev Get a resource
   * @template Resource The resource being read
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for a get operation.
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  @doc("Get a {name}", Resource)
  @armOperationRoute(OverrideRouteOptions)
  @get
  @readsResource(Resource)
  @legacyResourceOperation(Resource, "read", OverrideResourceName)
  @Private.armUpdateProviderNamespace
  Read<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<Resource>,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(...ParentParameters, ...ResourceTypeParameter, ...Parameters): Response | OverrideErrorType;

  /**
   * Check a resource's existence via HEAD operation
   * @template Resource The resource being checked
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for a head operation (by default NoContent or NotFound response).
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  @armOperationRoute(OverrideRouteOptions)
  @legacyResourceOperation(Resource, "checkExistence", OverrideResourceName)
  @doc("Check for the existence of a {name}", Resource)
  @Private.armUpdateProviderNamespace
  @head
  CheckExistence<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmResourceExistsResponse | ArmResourceNotFoundResponse,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  > is Foundations.ArmReadOperation<
    ParentParameters & ResourceTypeParameter & Parameters,
    Response,
    OverrideErrorType
  >;

  /**
   * List a resource
   * @template Resource The resource being listed
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The response returned by the list
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  @segmentOf(ResourceTypeParameter)
  @doc("List a {name}", Resource)
  @get
  @list
  @listsResource(Resource)
  @armOperationRoute(OverrideRouteOptions)
  @legacyResourceOperation(Resource, "list", OverrideResourceName)
  @Private.armUpdateProviderNamespace
  List<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(...ParentParameters, ...Parameters): Response | OverrideErrorType;

  /**
   * List a single page of the resource
   * @template Resource The resource being listed
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The response returned by the list
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  @segmentOf(ResourceTypeParameter)
  @doc("List a {name}", Resource)
  @get
  @listsResource(Resource)
  @armOperationRoute(OverrideRouteOptions)
  @legacyResourceOperation(Resource, "list", OverrideResourceName)
  @Private.armUpdateProviderNamespace
  ListSinglePage<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(...ParentParameters, ...Parameters): Response | OverrideErrorType;

  /**
   * A synchronous resource action.
   * @template Resource The resource being acted upon
   * @template Request The request model for the action
   * @template Response The response model for the action
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  @doc("")
  @legacyResourceOperation(Resource, "action", OverrideResourceName)
  @armOperationRoute(OverrideRouteOptions)
  @Private.enforceConstraint(Resource, Foundations.Resource)
  @post
  @Private.armUpdateProviderNamespace
  @returnsDoc("Azure operation completed successfully.")
  ActionSync<
    Resource extends Foundations.SimpleResource,
    Request,
    Response,
    Parameters extends {} = {},
    OptionalRequestBody extends valueof boolean = false,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(
    ...ParentParameters,
    ...ResourceTypeParameter,
    ...Parameters,

    @doc("The content of the action request")
    @armBodyRoot(OptionalRequestBody)
    body: Request,
  ): Response | OverrideErrorType;

  /**
   * A long-running resource action.
   * @template Resource The resource being acted upon
   * @template Request The request model for the action
   * @template Result The result model for the action when the operation is successful
   * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
   * @template Response The union of successful responses for the action
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template OverrideErrorType Optional. The error response, if non-standard.
   * @template OverrideRouteOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type being acted upon.
   */
  #suppress "@azure-tools/typespec-azure-core/no-response-body" "ARM"
  @doc("")
  @legacyResourceOperation(Resource, "action", OverrideResourceName)
  @armOperationRoute(OverrideRouteOptions)
  @Private.enforceConstraint(Resource, Foundations.Resource)
  @Private.armUpdateProviderNamespace
  @post
  @returnsDoc("Azure operation completed successfully.")
  ActionAsync<
    Resource extends Foundations.SimpleResource,
    Request,
    Result extends TypeSpec.Reflection.Model | void,
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
      Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
      Result,
      string
    > &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} | void =
      | ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>
      | Result,
    OptionalRequestBody extends valueof boolean = false,
    OverrideErrorType extends {} = ErrorType,
    OverrideRouteOptions extends valueof ArmOperationOptions = ResourceRoute,
    OverrideResourceName extends valueof string = "\${RoutedResourceName}"
  >(
    ...ParentParameters,
    ...ResourceTypeParameter,
    ...Parameters,

    @doc("The content of the action request")
    @armBodyRoot(OptionalRequestBody)
    body: Request,
  ): Response | OverrideErrorType;
}
/**
 * @dev DEPRECATED: Use ProviderParameter instead. Get the provider namespace key-value pair
 * @template Resource Optional.  The resource to get the provider namespace for.
 */
model Provider<Resource extends {} = TenantActionScope> {
  ...ProviderNamespace<Resource>;
}

/**
 * @dev Get the provider namespace key-value pair
 * @template Resource The resource to get the provider namespace for.
 */
model ProviderParameter<Resource extends {}> {
  ...ProviderNamespace<Resource>;
}

/**
 * A long-running resource update using a custom PATCH payload (Asynchronous)
 * @template Resource the resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional
 */
@autoRoute
@doc("Update a {name}", Resource)
@armResourceUpdate(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@patch(#{ implicitOptionality: false })
op CustomPatchAsync<
  Resource extends Foundations.SimpleResource,
  PatchModel extends TypeSpec.Reflection.Model | void = TagsUpdateModel<Resource>,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Resource,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResponse<Resource>
    | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
> is UpdateOperation<
  ResourceInstanceParameters<Resource, BaseParameters> & Parameters,
  PatchModel,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * A resource update using a custom PATCH payload (synchronous)
 * @template Resource the resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional
 */
@autoRoute
@doc("Update a {name}", Resource)
@armResourceUpdate(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@patch(#{ implicitOptionality: false })
op CustomPatchSync<
  Resource extends Foundations.SimpleResource,
  PatchModel extends TypeSpec.Reflection.Model | void = TagsUpdateModel<Resource>,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<Resource>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
> is UpdateOperation<
  ResourceInstanceParameters<Resource, BaseParameters> & Parameters,
  PatchModel,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * DEPRECATED: use CreateOrReplaceAsync instead.
 * A long-running resource CreateOrUpdate (PUT)
 * @template Resource the resource being created or updated
 * @template Request The request body for the operation
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional
 */
alias CreateOrUpdateAsync<
  Resource extends Foundations.SimpleResource,
  Request extends {} | void = Resource,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedResponse<Resource, LroHeaders>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
> = CreateOrReplaceAsync<
  Resource,
  Request,
  BaseParameters,
  LroHeaders,
  Parameters,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * A long-running resource CreateOrUpdate (PUT)
 * @template Resource the resource being created or updated
 * @template Request The request body for the operation
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional
 */
@autoRoute
@doc("Create a {name}", Resource)
@armResourceCreateOrUpdate(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
@put
op CreateOrReplaceAsync<
  Resource extends Foundations.SimpleResource,
  Request extends {} | void = Resource,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedResponse<Resource, LroHeaders>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
> is CreateOperation<
  ResourceInstanceParameters<Resource, BaseParameters> & Parameters,
  Request,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * DEPRECATED: use CreateOrReplaceSync instead.
 * Synchronous PUT operation for Azure Resource Manager resources
 * @template Resource the resource being created or replaced
 * @template Request The request body for the operation
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional
 */
alias CreateOrUpdateSync<
  Resource extends Foundations.SimpleResource,
  Request extends {} | void = Resource,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedSyncResponse<Resource>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
> = CreateOrReplaceSync<
  Resource,
  Request,
  BaseParameters,
  Parameters,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * Synchronous PUT operation for Azure Resource Manager resources
 * @template Resource the resource being created or replaced
 * @template Request The request body for the operation
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional
 */
@autoRoute
@doc("Create a {name}", Resource)
@armResourceCreateOrUpdate(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@put
op CreateOrReplaceSync<
  Resource extends Foundations.SimpleResource,
  Request extends {} | void = Resource,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedSyncResponse<Resource>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
> is CreateOperation<
  ResourceInstanceParameters<Resource, BaseParameters> & Parameters,
  Request,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * A resource list operation, at the subscription scope, that lists only a single page
 * @template Resource the resource being patched
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the list operation
 * @template Error Optional. The error response, if non-standard.
 */
@autoRoute
@doc("List {name} resources by subscription ID", Resource)
@listsResource(Resource)
@segmentOf(Resource)
@armResourceList(Resource)
@get
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmListSinglePageBySubscription<
  Resource extends Foundations.SimpleResource,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ResourceListResult<Resource>>,
  Error extends {} = ErrorResponse
> is ArmReadOperation<SubscriptionScope<Resource> & Parameters, Response, Error>;

/**
 * A resource list operation, at the scope of the resource's parent that lists only a single page.
 * @template Resource the resource being patched
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template ParentName Optional. The name of the parent resource
 * @template ParentFriendlyName Optional. The friendly name of the parent resource
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the list operation
 * @template Error Optional. The error response, if non-standard.
 */
@get
@autoRoute
@listsResource(Resource)
@segmentOf(Resource)
@Private.armRenameListByOperation(Resource, ParentName, ParentFriendlyName, false) // This must come before @armResourceList!
@armResourceList(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmListSinglePageByParent<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  ParentName extends valueof string = "",
  ParentFriendlyName extends valueof string = "",
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ResourceListResult<Resource>>,
  Error extends {} = ErrorResponse
> is ArmReadOperation<
  ResourceParentParameters<Resource, BaseParameters> & Parameters,
  Response,
  Error
>;

/**
 * @dev The base template for Azure Resource Manager PUT Operations.
 * @template HttpParameters The parameter object for the operation.
 * @template BodyParameter The body parameter
 * @template Response The response or union of responses for success.
 * @template ErrorResponse The error response.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional
 */
op CreateOperation<
  HttpParameters extends {},
  BodyParameter extends {} | void,
  Response extends {},
  ErrorResponse extends {},
  OptionalRequestBody extends valueof boolean = false
>(
  ...HttpParameters,

  @doc("Resource create parameters.")
  @armBodyRoot(OptionalRequestBody)
  resource: BodyParameter,
): Response | ErrorResponse;

/**
 * @dev The base template for Legacy Azure Resource Manager PATCH Operations.
 * @template HttpParameters The parameter object for the operation.
 * @template BodyParameter The body parameter
 * @template Response The response or union of responses for success.
 * @template ErrorResponse The error response.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional
 */
op UpdateOperation<
  HttpParameters extends {},
  BodyParameter extends {} | void,
  Response extends {},
  ErrorResponse extends {},
  OptionalRequestBody extends valueof boolean = false
>(
  ...HttpParameters,

  @doc("The resource properties to be updated.")
  @armBodyRoot(OptionalRequestBody)
  properties: BodyParameter,
): Response | ErrorResponse;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/interfaces.tsp":`import "@typespec/rest";
import "@typespec/http";

namespace Azure.ResourceManager.Legacy;

using Http;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;
using Rest;

/**
 * This is the interface that implements the standard Azure Resource Manager operation that returns
 * all supported RP operations. You should have exactly one declaration for each
 * Azure Resource Manager service. It implements
 *   GET "/providers/{provider-namespace}/operations"
 *
 * @template Response The response returned by the operation list.
 * @template Error the error response returned by the operation list.
 * @template Parameters Additional request parameters for the list operation.
 * @template Tag Optional. The openapi tag for the operation.
 */
interface Operations<
  Response extends {} = ArmResponse<OperationListResult>,
  Error extends {} = ErrorResponse,
  Parameters extends {} = {},
  Tag extends valueof string = "Operations"
> {
  @tag(Tag)
  @autoRoute
  @armUpdateProviderNamespace
  @doc("List the operations for the provider")
  @segment("operations")
  @get
  @list
  list(
    ...CommonTypes.ApiVersionParameter,

    @path
    @segment("providers")
    @doc("The provider namespace (this parameter will not show up in operations).")
    provider: "Microsoft.ThisWillBeReplaced",

    ...Parameters,
  ): Response | Error;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/extension.tsp":`import "@typespec/rest";
import "@typespec/http";

namespace Azure.ResourceManager.Legacy;

using Http;
using Azure.ResourceManager.Private;
using Rest;

/**
 * An operation template used to build extension resource operations using non-standard paths.
 * @template TargetParameters The path parameters for the target resource
 * @template ExtensionParentParameters Parent parameters of the extension resource
 * @template ExtensionInstanceParameters The instance parameters of the extension resource
 * @template ResourceName Optional. The name of the resource type at this scope in clients.
 */
@doc("")
interface ExtensionOperations<
  TargetParameters extends {},
  ExtensionParentParameters extends {},
  ExtensionInstanceParameters extends {},
  ResourceName extends valueof string = string("")
> {
  /**
   * A long-running resource CreateOrUpdate (PUT)
   * @template Resource the resource being created or updated
   * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the PUT operation
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template Request Optional. The request body for the createOrUpdate operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  @armOperationRoute(OperationOptions)
  @doc("Create a {name}", Resource)
  @legacyExtensionResourceOperation(Resource, "createOrUpdate", OverrideResourceName)
  @Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
  @put
  CreateOrUpdateAsync<
    Resource extends Foundations.SimpleResource,
    LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResourceUpdatedResponse<Resource>
      | ArmResourceCreatedResponse<Resource, LroHeaders>,
    OptionalRequestBody extends valueof boolean = false,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    Request extends {} | void = Resource,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...TargetParameters,
    ...ExtensionInstanceParameters,
    ...Parameters,
    @doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) resource: Request,
  ): Response | ErrorType;

  /**
   * A synchronous resource CreateOrUpdate (PUT)
   * @template Resource the resource being created or updated
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the PUT operation
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template Request Optional. The request body for the createOrUpdate operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  #suppress "@azure-tools/typespec-azure-core/no-private-usage"
  @armOperationRoute(OperationOptions)
  @doc("Create a {name}", Resource)
  @legacyExtensionResourceOperation(Resource, "createOrUpdate", OverrideResourceName)
  @put
  CreateOrUpdateSync<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResourceUpdatedResponse<Resource>
      | ArmResourceCreatedSyncResponse<Resource>,
    OptionalRequestBody extends valueof boolean = false,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    Request extends {} | void = Resource,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...TargetParameters,
    ...ExtensionInstanceParameters,
    ...Parameters,
    @doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) resource: Request,
  ): Response | ErrorType;

  /**
   * A long-running resource Update (PATCH)
   * @template Resource the resource being created or updated
   * @template PatchModel the PATCH request model
   * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the PATCH operation
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  @armOperationRoute(OperationOptions)
  @doc("Update a {name}", Resource)
  @legacyExtensionResourceOperation(Resource, "update", OverrideResourceName)
  @patch(#{ implicitOptionality: false })
  CustomPatchAsync<
    Resource extends Foundations.SimpleResource,
    PatchModel extends {} | void = Azure.ResourceManager.Foundations.TagsUpdateModel<Resource>,
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
      Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
      Resource,
      string
    > &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResponse<Resource>
      | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
    OptionalRequestBody extends valueof boolean = false,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...TargetParameters,
    ...ExtensionInstanceParameters,
    ...Parameters,
    @doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) properties: PatchModel,
  ): Response | ErrorType;

  /**
   * A synchronous resource Update (PATCH)
   * @template Resource the resource being created or updated
   * @template PatchModel the PATCH request model
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the PATCH operation
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  @armOperationRoute(OperationOptions)
  @doc("Update a {name}", Resource)
  @legacyExtensionResourceOperation(Resource, "update", OverrideResourceName)
  @patch(#{ implicitOptionality: false })
  CustomPatchSync<
    Resource extends Foundations.SimpleResource,
    PatchModel extends {} | void = Azure.ResourceManager.Foundations.TagsUpdateModel<Resource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<Resource>,
    OptionalRequestBody extends valueof boolean = false,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...TargetParameters,
    ...ExtensionInstanceParameters,
    ...Parameters,
    @doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) properties: PatchModel,
  ): Response | ErrorType;

  /**
   * Delete a resource asynchronously
   * @template Resource The resource being deleted
   * @template LroHeaders The lro headers for the operation
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the delete operation
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  #suppress "@azure-tools/typespec-azure-core/no-response-body" "Valid"
  @armOperationRoute(OperationOptions)
  @doc("Delete a {name}", Resource)
  @delete
  @deletesResource(Resource)
  @legacyExtensionResourceOperation(Resource, "delete", OverrideResourceName)
  DeleteWithoutOkAsync<
    Resource extends Foundations.SimpleResource,
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} = ArmDeleteAcceptedLroResponse<LroHeaders> | ArmDeletedNoContentResponse,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(...TargetParameters, ...ExtensionInstanceParameters, ...Parameters): Response | ErrorType;

  /**
   * Delete a resource synchronously
   * @template Resource The resource being deleted
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the delete operation
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  #suppress "@azure-tools/typespec-azure-core/no-response-body" "Valid"
  @armOperationRoute(OperationOptions)
  @doc("Delete a {name}", Resource)
  @delete
  @deletesResource(Resource)
  @legacyExtensionResourceOperation(Resource, "delete", OverrideResourceName)
  DeleteSync<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmDeletedResponse | ArmDeletedNoContentResponse,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(...TargetParameters, ...ExtensionInstanceParameters, ...Parameters): Response | ErrorType;

  /**
   * @dev Get a resource
   * @template Resource The resource being read
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for a get operation.
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  @armOperationRoute(OperationOptions)
  @doc("Get a {name}", Resource)
  @get
  @readsResource(Resource)
  @legacyExtensionResourceOperation(Resource, "read", OverrideResourceName)
  Read<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<Resource>,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(...TargetParameters, ...ExtensionInstanceParameters, ...Parameters): Response | ErrorType;

  /**
   * Check a resource's existence via HEAD operation
   * @template Resource The resource being checked
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for a head operation (by default NoContent or NotFound response).
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  @armOperationRoute(OperationOptions)
  @doc("Check for the existence of a {name}", Resource)
  @legacyExtensionResourceOperation(Resource, "checkExistence", OverrideResourceName)
  @head
  CheckExistence<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmResourceExistsResponse | ArmResourceNotFoundResponse,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is Foundations.ArmReadOperation<
    TargetParameters & ExtensionInstanceParameters & Parameters,
    Response,
    ErrorType
  >;
  /**
   * List a resource
   * @template Resource The resource being listed
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The response returned by the list
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  @armOperationRoute(OperationOptions)
  @doc("List a {name}", Resource)
  @get
  @list
  @listsResource(Resource)
  @legacyExtensionResourceOperation(Resource, "list", OverrideResourceName)
  List<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(...TargetParameters, ...ExtensionParentParameters, ...Parameters): Response | ErrorType;

  /**
   * List a resource, without pagination
   * @template Resource The resource being listed
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The response returned by the list
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  @armOperationRoute(OperationOptions)
  @doc("List a {name}", Resource)
  @get
  @listsResource(Resource)
  @legacyExtensionResourceOperation(Resource, "list", OverrideResourceName)
  ListSinglePage<
    Resource extends Foundations.SimpleResource,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(...TargetParameters, ...ExtensionParentParameters, ...Parameters): Response | ErrorType;

  /**
   * A synchronous resource action.
   * @template Resource The resource being acted upon
   * @template Request The request model for the action
   * @template Response The response model for the action
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  @doc("")
  @armOperationRoute(OperationOptions)
  @legacyExtensionResourceOperation(Resource, "action", OverrideResourceName)
  @Private.enforceConstraint(Resource, Foundations.Resource)
  @post
  @returnsDoc("Azure operation completed successfully.")
  ActionSync<
    Resource extends Foundations.SimpleResource,
    Request,
    Response extends TypeSpec.Reflection.Model | void,
    Parameters extends {} = {},
    OptionalRequestBody extends valueof boolean = false,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...TargetParameters,
    ...ExtensionInstanceParameters,
    ...Parameters,

    @doc("The content of the action request")
    @armBodyRoot(OptionalRequestBody)
    body: Request,
  ): Response | ErrorType;

  /**
   * A long-running resource action.
   * @template Resource The resource being acted upon
   * @template Request The request model for the action
   * @template Result The result model for the action
   * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
   * @template Response The full response union of the action
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template OptionalRequestBody Optional. Indicates whether the request body is optional
   * @template ErrorType Optional. The error response, if non-standard.
   * @template OperationOptions Optional. The route options for the operation.
   * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
   */
  #suppress "@azure-tools/typespec-azure-core/no-response-body" "ARM"
  @doc("")
  @armOperationRoute(OperationOptions)
  @legacyExtensionResourceOperation(Resource, "action", OverrideResourceName)
  @Private.enforceConstraint(Resource, Foundations.Resource)
  @post
  @returnsDoc("Azure operation completed successfully.")
  ActionAsync<
    Resource extends Foundations.SimpleResource,
    Request,
    Result extends TypeSpec.Reflection.Model | void,
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
      Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
      Result,
      string
    > &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} | void =
      | ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>
      | Result,
    OptionalRequestBody extends valueof boolean = false,
    ErrorType extends {} = ErrorResponse,
    OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false },
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...TargetParameters,
    ...ExtensionInstanceParameters,
    ...Parameters,

    @doc("The content of the action request")
    @armBodyRoot(OptionalRequestBody)
    body: Request,
  ): Response | ErrorType;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/extension-operations.tsp":`import "@typespec/rest";
import "@typespec/http";

namespace Azure.ResourceManager.Legacy.Extension;

using Http;
using Azure.ResourceManager.Foundations;
using Rest;
using Azure.ResourceManager.Private;

/**
 * DEPRECATED: Use CreateOrReplaceAsync instead.
 * A long-running resource CreateOrUpdate (PUT)
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being created or updated
 * @template Request Optional. The request body for the createOrUpdate operation
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. If true, the request body is optional
 * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
 */
alias CreateOrUpdateAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Request extends {} | void = ExtensionResource,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = ExtensionResource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<ExtensionResource>
    | ArmResourceCreatedResponse<ExtensionResource, LroHeaders>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
> = CreateOrReplaceAsync<
  TargetResource,
  ExtensionResource,
  Request,
  LroHeaders,
  Parameters,
  Response,
  Error,
  OptionalRequestBody,
  OverrideResourceName
>;

/** A long-running resource CreateOrUpdate (PUT)
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being created or updated
 * @template Request Optional. The request body for the createOrUpdate operation
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. If true, the request body is optional
 * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
 */
@autoRoute
@doc("Create a {name}", ExtensionResource)
@extensionResourceOperation(
  TargetResource,
  ExtensionResource,
  "createOrUpdate",
  OverrideResourceName
)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
@put
op CreateOrReplaceAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Request extends {} | void = ExtensionResource,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = ExtensionResource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<ExtensionResource>
    | ArmResourceCreatedResponse<ExtensionResource, LroHeaders>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
> is CreateOperation<
  Azure.ResourceManager.Extension.ExtensionInstanceParameters<TargetResource, ExtensionResource> &
    Parameters,
  Request,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * Synchronous PUT operation for Azure Resource Manager resources
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being created or replaced
 * @template Request Optional. The request body for the createOrUpdate operation
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. If true, the request body is optional
 * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
 */
@autoRoute
@doc("Create a {name}", ExtensionResource)
@extensionResourceOperation(
  TargetResource,
  ExtensionResource,
  "createOrUpdate",
  OverrideResourceName
)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@put
op CreateOrReplaceSync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Request extends {} | void = ExtensionResource,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<ExtensionResource>
    | ArmResourceCreatedSyncResponse<ExtensionResource>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
> is CreateOperation<
  Azure.ResourceManager.Extension.ExtensionInstanceParameters<TargetResource, ExtensionResource> &
    Parameters,
  Request,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * A long-running resource update using a custom PATCH payload (Asynchronous)
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template LroHeaders Optional.  Allows overriding the lro headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Whether the request body is optional.
 * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
 */
@autoRoute
@doc("Update a {name}", ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "update", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@patch(#{ implicitOptionality: false })
op CustomPatchAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  PatchModel extends TypeSpec.Reflection.Model | void = TagsUpdateModel<ExtensionResource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    ExtensionResource,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResponse<ExtensionResource>
    | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
> is UpdateOperation<
  Azure.ResourceManager.Extension.ExtensionInstanceParameters<TargetResource, ExtensionResource> &
    Parameters,
  PatchModel,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * A resource update using a custom PATCH payload (synchronous)
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Whether the request body is optional.
 * @template OverrideResourceName Optional. The name of the resource type at this scope in clients.
 */
@autoRoute
@doc("Update a {name}", ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "update", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@patch(#{ implicitOptionality: false })
op CustomPatchSync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  PatchModel extends TypeSpec.Reflection.Model | void = TagsUpdateModel<ExtensionResource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ExtensionResource>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
> is UpdateOperation<
  Azure.ResourceManager.Extension.ExtensionInstanceParameters<TargetResource, ExtensionResource> &
    Parameters,
  PatchModel,
  Response,
  Error,
  OptionalRequestBody
>;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/private-endpoints.tsp":`import "@typespec/rest";
import "@typespec/http";

namespace Azure.ResourceManager.Legacy.PrivateEndpoints;

using Http;
using Azure.ResourceManager.Foundations;
using Rest;

/**
 * @dev List the private endpoint connections over a resource
 * @template ParentResource the parent resource of the PrivateEndpointConnection
 * @template Resource Optional. The PrivateEndpointConnection resource being listed
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template ParentName Optional. The name of the parent resource
 * @template ParentFriendlyName Optional. The friendly name of the parent resource
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the list operation
 * @template Error Optional. The error response, if non-standard.
 */
@doc("List {name} PrivateEndpointConnections", ParentResource)
@get
@autoRoute
@listsResource(Resource)
@segmentOf(PrivateEndpointConnectionParameter)
@armResourceList(Resource)
@Private.enforceConstraint(ParentResource, Foundations.Resource)
op ListSinglePageByParent<
  ParentResource extends Foundations.SimpleResource,
  Resource extends PrivateEndpointConnectionResource,
  BaseParameters = DefaultBaseParameters<ParentResource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ResourceListResult<Resource>>,
  Error extends {} = ErrorResponse
> is ArmReadOperation<
  ResourceInstanceParameters<ParentResource, BaseParameters> & Parameters,
  Response,
  Error
>;

/**
 * @dev Synchronous PUT operation for a Private endpoint connection to a resource
 * @template ParentResource the parent resource of the PrivateEndpointConnection
 * @template Resource the PrivateEndpointConnection resource being created or updated
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 * @template Request Optional. The request body for the operation.
 */
@autoRoute
@doc("Create a {name} PrivateEndpointConnection", ParentResource)
@armResourceCreateOrUpdate(Resource)
@Private.enforceConstraint(ParentResource, Foundations.Resource)
@put
op CreateOrReplaceSync<
  ParentResource extends Foundations.SimpleResource,
  Resource extends PrivateEndpointConnectionResource,
  BaseParameters = DefaultBaseParameters<ParentResource>,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedSyncResponse<Resource>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Request extends {} | void = Resource
> is Azure.ResourceManager.Legacy.CreateOperation<
  ResourceInstanceParameters<ParentResource, BaseParameters> &
    KeysOf<PrivateEndpointConnectionParameter> &
    Parameters,
  Request,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * @dev A long-running resource CreateOrUpdate (PUT) for a PrivateEndpointConnection to a resource
 * @template ParentResource the parent resource of the PrivateEndpointConnection
 * @template Resource the PrivateEndpointConnection resource being created or updated
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrReplace operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 * @template Request Optional. The request body for the operation.
 */
@autoRoute
@doc("Create a {name} PrivateEndpointConnection", ParentResource)
@armResourceCreateOrUpdate(Resource)
@Private.enforceConstraint(ParentResource, Foundations.Resource)
@Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
@put
op CreateOrReplaceAsync<
  ParentResource extends Foundations.SimpleResource,
  Resource extends PrivateEndpointConnectionResource,
  BaseParameters = DefaultBaseParameters<ParentResource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedResponse<Resource, LroHeaders>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Request extends {} | void = Resource
> is Azure.ResourceManager.Legacy.CreateOperation<
  ResourceInstanceParameters<ParentResource, BaseParameters> &
    KeysOf<PrivateEndpointConnectionParameter> &
    Parameters,
  Request,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * A long-running resource update using a custom PATCH payload (Asynchronous) to update a PrivateEndpointConnection to a resource.
 * @template ParentResource the parent resource of the PrivateEndpointConnection
 * @template Resource the PrivateEndpointConnection resource being updated
 * @template PatchModel The input model for the PATCH request
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 */
@autoRoute
@doc("Update a {name} PrivateEndpointConnection", ParentResource)
@armResourceUpdate(Resource)
@Private.enforceConstraint(ParentResource, Foundations.Resource)
@patch(#{ implicitOptionality: false })
op CustomPatchAsync<
  ParentResource extends Foundations.SimpleResource,
  Resource extends PrivateEndpointConnectionResource,
  PatchModel extends {} | void = PrivateEndpointConnectionUpdate,
  BaseParameters = DefaultBaseParameters<ParentResource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Resource,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResponse<Resource>
    | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
> is Azure.ResourceManager.Legacy.UpdateOperation<
  ResourceInstanceParameters<ParentResource, BaseParameters> &
    KeysOf<PrivateEndpointConnectionParameter> &
    Parameters,
  PatchModel,
  Response,
  Error,
  OptionalRequestBody
>;

/**
 * @dev A resource update using a custom PATCH payload (synchronous) to update a PrivateEndpointConnection to a resource
 * @template ParentResource The parent resource of the PrivateEndpointConnection
 * @template Resource Optional. The PrivateEndpointConnection resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 */
@autoRoute
@doc("Update a {name} PrivateEndpointConnection", ParentResource)
@armResourceUpdate(Resource)
@Private.enforceConstraint(ParentResource, Foundations.Resource)
@patch(#{ implicitOptionality: false })
op CustomPatchSync<
  ParentResource extends Foundations.SimpleResource,
  Resource extends PrivateEndpointConnectionResource,
  PatchModel extends {} | void = PrivateEndpointConnectionUpdate,
  BaseParameters = DefaultBaseParameters<ParentResource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<Resource>,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
> is Azure.ResourceManager.Legacy.UpdateOperation<
  ResourceInstanceParameters<ParentResource, BaseParameters> &
    KeysOf<PrivateEndpointConnectionParameter> &
    Parameters,
  PatchModel,
  Response,
  Error,
  OptionalRequestBody
>;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/legacy-types/resource.tsp":`import "@typespec/rest";
import "@typespec/http";

namespace Azure.ResourceManager.Legacy;

using Azure.ResourceManager.Private;

/**
 * This type uses an optional location property, only used by legacy APIs.
 * Concrete tracked resource types can be created by aliasing this type using a specific property type.
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 * @template Properties A model containing the provider-specific properties for this resource
 * @template PropertiesOptional A boolean flag indicating whether the resource \`Properties\` field is marked as optional or required. Default true is optional and recommended.
 *
 * @example
 * \`\`\`typespec
 * model Employee is TrackedResourceWithOptionalLocation<EmployeeProperties> {
 *  ...ResourceNameParameter<Employee>
 * }
 * \`\`\`
 */
@doc("Concrete tracked resource types can be created by aliasing this type using a specific property type.")
@armResourceInternal(Properties)
@Http.Private.includeInapplicableMetadataInPayload(false)
model TrackedResourceWithOptionalLocation<
  Properties extends {},
  PropertiesOptional extends valueof boolean = true
> extends CommonTypes.Resource {
  @doc("The RP-specific properties for this resource.")
  @armResourcePropertiesOptionality(PropertiesOptional)
  properties?: Properties;

  /** Resource tags. */
  tags?: Record<string>;

  /** The geo-location where the resource lives */
  @visibility(Lifecycle.Read, Lifecycle.Create)
  location?: string;
}

/**
 * Model used only to spread in the standard \`etag\` envelope property for a resource
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   // Only have standard Succeeded, Failed, Cancelled states
 *   ...ETagProperty;
 * }
 * \`\`\`
 */
alias EntityTagProperty = {
  /** "If etag is provided in the response body, it may also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.") */
  @visibility(Lifecycle.Read)
  etag?: string;
};

/**
 * Legacy. Model representing a non-standard \`extendedLocation\` envelope property with all properties optional.
 * Spread this model into a Resource Model, if you are converting a BrownField API with extended location that has optional properties
 *
 * @example
 * \`\`\`typespec
 * model Employee is TrackedResource<EmployeeProperties> {
 * ...ResourceNameParameter<Employee>;
 * ...ExtendedLocationOptionalProperty;
 * }
 * \`\`\`
 */
model ExtendedLocationOptionalProperty {
  @visibility(Lifecycle.Read, Lifecycle.Create)
  extendedLocation?: ExtendedLocationOptional;
}

/** The complex type of the extended location. */
@friendlyName("ExtendedLocation")
model ExtendedLocationOptional {
  /** The name of the extended location. */
  name?: string;

  /** The type of the extended location. */
  type?: Azure.ResourceManager.Foundations.ExtendedLocationType;
}

/**
 * Template that allows a model to include a path parameter property without adding the property to a request body
 */
@Http.Private.includeInapplicableMetadataInPayload(false)
model ResourceWithPathParameter {}

/**
 * Model representing the  \`kind\` envelope property only for use with a polymorphic resource..
 * Spread this model into a resource model if the resource support ARM \`kind\`.
 * @template Type The type of the kind property. Default is string. However you can pass a union with string values.
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   // Only have standard Succeeded, Failed, Cancelled states
 *   ...PolymorphicResourceKindProperty;
 * }
 * \`\`\`
 */
@doc("The resource kind property envelope.")
model PolymorphicResourceKindProperty<Type extends string = string> {
  @doc("Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist this value.")
  @pattern("^[-\\\\w\\\\._,\\\\(\\\\\\\\\\\\)]+$")
  @visibility(Lifecycle.Read, Lifecycle.Create)
  kind: Type;
}

/**
 * Discriminated tracked resource types can be created by instantiating this type, with 'kind' as the discriminator property.
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 * @template KindType The type of the discriminator property \`kind\`. Default is string.
 * @template Description A description of the resource
 *
 * @example
 * \`\`\`typespec
 * model Pet is DiscriminatedTrackedResource {}
 *
 * model Dog extends Pet {
 *  kind: "dog";
 *  properties: DogProperties;
 * }
 * \`\`\`
 */
@doc(Description)
@armResourceInternal({})
@discriminator("kind")
@Http.Private.includeInapplicableMetadataInPayload(false)
model DiscriminatedTrackedResource<
  KindType extends string = string,
  Description extends valueof string = "Polymorphic Tracked resource types can be created by instantiating this type, with 'kind' as the discriminator."
> extends Foundations.TrackedResource {
  ...PolymorphicResourceKindProperty<KindType>;
}

/**
 * Discriminated proxy resource types can be created by instantiating using this type, with 'kind' as the discriminator property.
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 * @template KindType The type of the discriminator property \`kind\`. Default is string.
 * @template Description A description of the resource
 *
 * @example
 * \`\`\`typespec
 * model Pet is DiscriminatedProxyResource {}
 *
 * model Dog extends Pet {
 *  kind: "dog";
 *  properties: DogProperties;
 * }
 * \`\`\`
 */
@doc(Description)
@armResourceInternal({})
@discriminator("kind")
@Http.Private.includeInapplicableMetadataInPayload(false)
model DiscriminatedProxyResource<
  KindType extends string = string,
  Description extends valueof string = "Polymorphic proxy resource types can be created by instantiating this type, using 'kind' as the discriminator property."
> extends Foundations.ProxyResource {
  ...PolymorphicResourceKindProperty<KindType>;
}

/**
 * Polymorphic extension resources can be instantiated using this type, using 'kind' as the discriminator property.
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 * @template KindType The type of the discriminator property \`kind\`. Default is string.
 * @template Description A description of the resource
 *
 * @example
 * \`\`\`typespec
 * model Pet is DiscriminatedExtensionResource {}
 *
 * model Dog extends Pet {
 *  kind: "dog";
 *  properties: DogProperties;
 * }
 * \`\`\`
 */
@extensionResource
@doc(Description)
@armResourceInternal({})
@discriminator("kind")
@Http.Private.includeInapplicableMetadataInPayload(false)
model DiscriminatedExtensionResource<
  KindType extends string = string,
  Description extends valueof string = "Polymorphic extension resource types can be created by aliasing this type using a specific property type."
> extends Foundations.ExtensionResource {
  ...PolymorphicResourceKindProperty<KindType>;
}

/**
 * Model representing a custom Azure Resource Manager Resource.
 * Use this template with 'is' to create a custom resource.
 * @template isResource Optional. A boolean flag indicating whether the resource should be marked as an Azure resource. Default true.
 */
@Http.Private.includeInapplicableMetadataInPayload(false)
@customAzureResource(#{ isAzureResource: isResource })
model CustomAzureResource<isResource extends valueof boolean = true> {}

/**
 * Model representing a custom resource that extends ProxyResource.
 * Use this template with 'is' to create a custom proxy resource.
 * @template isResource Optional. A boolean flag indicating whether the resource should be marked as an Azure resource. Default false.
 */
@Http.Private.includeInapplicableMetadataInPayload(false)
@customAzureResource(#{ isAzureResource: isResource })
model CustomAzureProxyResource<isResource extends valueof boolean = false>
  extends Foundations.ProxyResource {}

/**
 * A generic Azure Resource Manager resource type that does not require name, key,
 * or segment properties on the model itself. The resource type and path information
 * comes from the operations (e.g. RoutedOperations).
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 * @template Properties A model containing the provider-specific properties for this resource
 * @template PropertiesOptional A boolean flag indicating whether the resource \`Properties\` field is marked as optional or required. Default true is optional and recommended.
 *
 * @example
 * \`\`\`typespec
 * model MyResource is GenericResource<{}> {}
 * \`\`\`
 */
@doc("A generic Azure Resource Manager resource type.")
@Private.genericResourceInternal
@Http.Private.includeInapplicableMetadataInPayload(false)
model GenericResource<Properties, PropertiesOptional extends valueof boolean = true>
  extends Foundations.Resource {
  @doc("The resource-specific properties for this resource.")
  @Azure.ResourceManager.Private.armResourcePropertiesOptionality(PropertiesOptional)
  properties?: Properties;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/extension/extension.tsp":`import "@azure-tools/typespec-azure-core";
import "./operations.tsp";
import "./parameters.tsp";
import "./private.decorators.tsp";

namespace Azure.ResourceManager.Extension;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/extension/operations.tsp":`namespace Azure.ResourceManager.Extension;

using Http;
using Rest;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;

// OPERATION TEMPLATES

/**
 * List an extension resource at the given target scope
 * @template TargetResource The target to list at, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being listed
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the list operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@doc("List {name} resources by scope", ExtensionResource)
@list
@listsResource(ExtensionResource)
@segmentOf(ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "list", OverrideResourceName)
@get
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
op ListByTarget<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ResourceListResult<ExtensionResource>>,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is ArmReadOperation<
  ExtensionParentParameters<TargetResource, ExtensionResource> & Parameters,
  Response,
  Error
>;

/**
 * A resource GET operation
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being read
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the read operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@doc("Get a {name}", ExtensionResource)
@get
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@extensionResourceOperation(TargetResource, ExtensionResource, "read", OverrideResourceName)
op Read<
  TargetResource extends SimpleResource,
  ExtensionResource extends SimpleResource,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ExtensionResource>,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is ArmReadOperation<
  ExtensionInstanceParameters<TargetResource, ExtensionResource> & Parameters,
  Response,
  Error
>;

/**
 * Check a resource's existence via HEAD operation
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the extension resource being checked
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the read operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@doc("Check for the existence of a {name}", ExtensionResource)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@extensionResourceOperation(
  TargetResource,
  ExtensionResource,
  "checkExistence",
  OverrideResourceName
)
@head
op CheckExistence<
  TargetResource extends SimpleResource,
  ExtensionResource extends SimpleResource,
  Parameters extends {} = {},
  Response extends {} = ArmResourceExistsResponse | ArmResourceNotFoundResponse,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is ArmReadOperation<
  ExtensionInstanceParameters<TargetResource, ExtensionResource> & Parameters,
  Response,
  Error
>;

/**
 * A long-running resource CreateOrUpdate (PUT)
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being created or updated
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients
 */
@autoRoute
@doc("Create a {name}", ExtensionResource)
@extensionResourceOperation(
  TargetResource,
  ExtensionResource,
  "createOrUpdate",
  OverrideResourceName
)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
@put
op CreateOrUpdateAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = ExtensionResource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<ExtensionResource>
    | ArmResourceCreatedResponse<ExtensionResource, LroHeaders>,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is ArmCreateOperation<
  ExtensionInstanceParameters<TargetResource, ExtensionResource> & Parameters,
  ExtensionResource,
  Response,
  Error
>;

/**
 * Synchronous PUT operation for Azure Resource Manager resources
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being created or replaced
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrReplace operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@doc("Create a {name}", ExtensionResource)
@extensionResourceOperation(
  TargetResource,
  ExtensionResource,
  "createOrUpdate",
  OverrideResourceName
)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@put
op CreateOrReplaceSync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<ExtensionResource>
    | ArmResourceCreatedSyncResponse<ExtensionResource>,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is ArmCreateOperation<
  ExtensionInstanceParameters<TargetResource, ExtensionResource> & Parameters,
  ExtensionResource,
  Response,
  Error
>;

/**
 * @dev A long-running resource CreateOrUpdate (PUT)
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being created or replaced
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrReplace operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients
 */
@autoRoute
@doc("Create a {name}", ExtensionResource)
@extensionResourceOperation(
  TargetResource,
  ExtensionResource,
  "createOrUpdate",
  OverrideResourceName
)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
op CreateOrReplaceAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = ExtensionResource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<ExtensionResource>
    | ArmResourceCreatedResponse<ExtensionResource, LroHeaders>,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is CreateOrUpdateAsync<
  TargetResource,
  ExtensionResource,
  LroHeaders,
  Parameters,
  Response,
  Error,
  OverrideResourceName
>;

/**
 * A long-running resource update using a custom PATCH payload (Asynchronous)
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template LroHeaders Optional.  Allows overriding the lro headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients
 */
@autoRoute
@doc("Update a {name}", ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "update", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@patch(#{ implicitOptionality: false })
op CustomPatchAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  PatchModel extends TypeSpec.Reflection.Model = TagsUpdateModel<ExtensionResource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    ExtensionResource,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResponse<ExtensionResource>
    | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is ArmUpdateOperation<
  ExtensionInstanceParameters<TargetResource, ExtensionResource> & Parameters,
  PatchModel,
  Response,
  Error
>;

/**
 * A resource update using a custom PATCH payload (synchronous)
 * @template TargetResource the target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource the resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@doc("Update a {name}", ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "update", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@patch(#{ implicitOptionality: false })
op CustomPatchSync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  PatchModel extends TypeSpec.Reflection.Model = TagsUpdateModel<ExtensionResource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ExtensionResource>,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is ArmUpdateOperation<
  ExtensionInstanceParameters<TargetResource, ExtensionResource> & Parameters,
  PatchModel,
  Response,
  Error
>;

/**
 * @dev Delete a resource asynchronously
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being deleted
 * @template Response The response type for the operation
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@doc("Delete a {name}", ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "delete", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@delete
op DeleteAsyncBase<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Response,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
>(...ExtensionInstanceParameters<TargetResource, ExtensionResource>, ...Parameters):
  | Response
  | Error;

/**
 * @dev Delete a resource asynchronously.
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being deleted
 * @template LroHeaders Optional. Allows overriding the headers in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response(s) for the delete operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
#deprecated "Use 'DeleteWithoutOkAsync' instead"
@autoRoute
@doc("Delete a {name}", ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "delete", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
op DeleteAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmDeletedResponse
    | ArmDeleteAcceptedLroResponse<LroHeaders>
    | ArmDeletedNoContentResponse,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is DeleteAsyncBase<
  TargetResource,
  ExtensionResource,
  Response,
  Parameters,
  Error,
  OverrideResourceName
>;

/**
 * @dev Delete a resource asynchronously
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being deleted
 * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response(s) for the delete operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@doc("Delete a {name}", ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "delete", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
op DeleteWithoutOkAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} = ArmDeleteAcceptedLroResponse<LroHeaders> | ArmDeletedNoContentResponse,
  Error extends {} = ErrorResponse,
  OverrideResourceName extends valueof string = ""
> is DeleteAsyncBase<
  TargetResource,
  ExtensionResource,
  Response,
  Parameters,
  Error,
  OverrideResourceName
>;

/**
 * Delete a resource synchronously
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being deleted
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response(s) for the delete operation
 * @template Error Optional. The error response, if non-standard.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@doc("Delete a {name}", ExtensionResource)
@extensionResourceOperation(TargetResource, ExtensionResource, "delete", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@delete
op DeleteSync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Parameters extends {} = {},
  Response extends {} = ArmDeletedResponse | ArmDeletedNoContentResponse,
  Error = ErrorResponse,
  OverrideResourceName extends valueof string = ""
>(...ExtensionInstanceParameters<TargetResource, ExtensionResource>, ...Parameters):
  | Response
  | Error;

/**
 * A long-running resource action.
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being acted upon
 * @template Request The request model for the action
 * @template Response The response type for the action
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@extensionResourceOperation(TargetResource, ExtensionResource, "action", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@post
op ActionAsyncBase<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Request extends TypeSpec.Reflection.Model | void,
  Response extends TypeSpec.Reflection.Model | void,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
>(
  ...ExtensionInstanceParameters<TargetResource, ExtensionResource>,
  ...Parameters,

  @doc("The content of the action request")
  @armBodyRoot(OptionalRequestBody)
  body: Request,
): Response | Error;

/**
 * @dev A long-running resource action.
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being acted upon
 * @template Request The request model for the action
 * @template Response The response model for the action
 * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the body parameter is optional.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@extensionResourceOperation(TargetResource, ExtensionResource, "action", OverrideResourceName)
@returnsDoc("Azure operation completed successfully.")
@enforceConstraint(ExtensionResource, Foundations.Resource)
op ActionAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Request extends TypeSpec.Reflection.Model | void,
  Response extends TypeSpec.Reflection.Model | void,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Response,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
> is ActionAsyncBase<
  TargetResource,
  ExtensionResource,
  Request,
  ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders> | Response,
  Parameters,
  Error,
  OptionalRequestBody
>;

/**
 * A synchronous resource action.
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being acted upon
 * @template Request The request model for the action
 * @template Response The response model for the action
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the body parameter is optional.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@extensionResourceOperation(TargetResource, ExtensionResource, "action", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@post
@returnsDoc("Azure operation completed successfully.")
op ActionSync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Request extends TypeSpec.Reflection.Model | void,
  Response extends TypeSpec.Reflection.Model | void,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
>(
  ...ExtensionInstanceParameters<TargetResource, ExtensionResource>,
  ...Parameters,

  @doc("The content of the action request")
  @armBodyRoot(OptionalRequestBody)
  body: Request,
): Response | Error;

/**
 * @dev A long-running resource action that returns no content.
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being acted upon
 * @template Request The request model for the action
 * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the body parameter is optional.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 */
@autoRoute
@extensionResourceOperation(TargetResource, ExtensionResource, "action", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@post
op ActionNoResponseContentAsync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Request extends TypeSpec.Reflection.Model | void,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    void,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
> is ActionAsyncBase<
  TargetResource,
  ExtensionResource,
  Request,
  ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>,
  Parameters,
  Error,
  OptionalRequestBody
>;

/**
 * A synchronous resource action that returns no content.
 * @template TargetResource The target resource, e.g. Extension.Subscription or Extension.ManagementGroup or Extension.ResourceGroup
 * @template ExtensionResource The resource being acted upon
 * @template Request The request model for the action
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 * @template OverrideResourceName Optional. Allows overriding the resource name for this scope in generated clients.
 *
 */
@autoRoute
@extensionResourceOperation(TargetResource, ExtensionResource, "action", OverrideResourceName)
@enforceConstraint(TargetResource, Foundations.Resource)
@enforceConstraint(ExtensionResource, Foundations.Resource)
@post
op ActionNoContentSync<
  TargetResource extends Foundations.SimpleResource,
  ExtensionResource extends Foundations.SimpleResource,
  Request extends TypeSpec.Reflection.Model | void,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  OverrideResourceName extends valueof string = ""
>(
  ...ExtensionInstanceParameters<TargetResource, ExtensionResource>,
  ...Parameters,

  @doc("The content of the action request")
  @armBodyRoot(OptionalRequestBody)
  body: Request,
): ArmNoContentResponse<"Action completed successfully."> | Error;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/extension/parameters.tsp":`namespace Azure.ResourceManager.Extension;

using Http;
using Rest;
using Azure.ResourceManager.Private;
using Azure.ResourceManager.Extension.Private;
using Azure.ResourceManager.CommonTypes;

/**
 * The default scope parameter for an extension resource.
 * @template Type The type of the scope parameter (default is string). This can be used to specify \`Azure.Core.armResourceIdentifier\` type or other constrained type
 *
 * @example
 * \`\`\`typespec
 * model Employee {
 *  ...ResourceUriParameter;
 * }
 * \`\`\`
 */
@builtInResource
model ScopeParameter<Type extends string = string> {
  @path(#{ allowReserved: true })
  @key
  @doc("The fully qualified Azure Resource manager identifier of the resource.")
  scope: Type;
}

/**
 * Base parameters for an extension target.
 * @template Resource The resource model for an extension target (usually Extension.Tenant, Extension.Subscription, Extension.ResourceGroup, Extension.Scope, Extension.ManagementGroup or an external resource).
 *
 */
@resourceBaseParametersOf(Resource)
model TargetBaseParameters<Resource extends {}> {
  ...ApiVersionParameter;

  // unless built-in, tenant or extension
  ...CommonTypes.SubscriptionIdParameter;

  // unless built-in tenant, subscription, location, or extension
  ...CommonTypes.ResourceGroupNameParameter;

  // unless built-in
  ...TargetProviderNamespace<Resource>;
}

/** The path parameters for a target resource for an extension
 * @template Resource The resource model for an extension target (usually Extension.Tenant, Extension.Subscription, Extension.ResourceGroup, Extension.Scope, Extension.ManagementGroup or an external resource).
 */
model TargetParameters<Resource extends {}> {
  ...TargetBaseParameters<Resource>;
  ...KeysOf<Resource>;
}

/** The provider namespace for an extension resource
 * @template Resource The extension resource model
 */
model ExtensionProviderNamespace<Resource extends {}> {
  @path
  @segment("providers")
  @assignUniqueProviderNameValue(Resource)
  @doc("The provider namespace for the resource.")
  extensionProvider: "Microsoft.ExtensionProviderNamespace";
}

/** The provider namespace (if any) for a target resource for an extension
 * @template Resource The resource model for an extension target (usually Extension.Tenant, Extension.Subscription, Extension.ResourceGroup, Extension.Scope, Extension.ManagementGroup or an external resource)
 */
model TargetProviderNamespace<Resource extends {}> {
  @resourceParameterBaseFor(
    [
      ResourceHome.Extension,
      ResourceHome.Location,
      ResourceHome.ResourceGroup,
      ResourceHome.Subscription,
      ResourceHome.Tenant
    ]
  )
  @path
  @segment("providers")
  @doc("The provider namespace for the resource.")
  @assignUniqueProviderNameValue(Resource)
  provider: "Microsoft.TargetProviderNamespace";
}

/** The path parameters for an extension resource at the given target
 * @template TargetResource The target of the extension resource (Extension.Tenant, Extension.Subscription, Extension.ResourceGroup, Extension.Scope, Extension.ManagementGroup or another resource).
 * @template Resource The extension resource.
 */
model ExtensionInstanceParameters<TargetResource extends {}, Resource extends {}> {
  ...TargetParameters<TargetResource>;
  ...ExtensionProviderNamespace<Resource>;
  ...KeysOf<Resource>;
}

/** The path parameters for a collection of extension resources at the given target
 * @template TargetResource The target of the extension resource (Extension.Tenant, Extension.Subscription, Extension.ResourceGroup, Extension.Scope, Extension.ManagementGroup or another resource).
 * @template ExtensionResource The extension resource.
 */
model ExtensionParentParameters<TargetResource extends {}, ExtensionResource extends {}> {
  ...TargetParameters<TargetResource>;
  ...ExtensionProviderNamespace<ExtensionResource>;
  ...ParentKeysOf<ExtensionResource>;
}

/** A tenant target for the extension resource */
@builtInResource
model Tenant {}

/** A management group
 * @template ParameterName The name of the 'name' parameter of the management group (usually managementGroupName or managementGroupId).
 */
@tenantResource
@armVirtualResource("Microsoft.Management")
model ManagementGroup<ParameterName extends valueof string = "managementGroupName"> {
  @path
  @minLength(1)
  @segment("managementGroups")
  @key(ParameterName)
  @doc("The management group ID.")
  name: string;
}

/** An external resource target, used when an extension targets a resource from another provider namespace
 * @template TargetNamespace The provider namespace for the external resource.
 * @template ResourceType The type of the external resource.
 * @template ResourceParameterName The name of the 'name' parameter of the external resource.
 * @template NamePattern The pattern restriction for the name of the external resource (default is none).
 * @template NameType The type of the name parameter of the external resource (default is string).
 * @template Description The description of the name parameter of the external resource (default is "The name of the resource").
 * @template ParentType The parent type of the external resource (default is "ResourceGroup", other options are "Tenant" and "Subscription").
 *
 * @example
 * \`\`\`typespec
 * alias VirtualMachine = ExternalResource<"Microsoft.Compute", "virtualMachines", "vmName">;
 *
 * \`\`\`
 *
 * @example
 * \`\`\`typespec
 * alias Scaleset = Extension.ExternalResource<
 *   "Microsoft.Compute",
 *   "virtualMachineScaleSets",
 *   "scaleSetName"
 * >;
 
 * \`\`\`
 */
@doc("")
@armVirtualResource(TargetNamespace)
@Azure.ResourceManager.Private.resourceParentType(ParentType)
@Http.Private.includeInapplicableMetadataInPayload(false)
model ExternalResource<
  TargetNamespace extends valueof string,
  ResourceType extends valueof string,
  ResourceParameterName extends valueof string,
  NamePattern extends valueof string = "",
  NameType extends string = string,
  Description extends valueof string = "The name of the resource",
  ParentType extends valueof "Tenant" | "Subscription" | "ResourceGroup" = "ResourceGroup"
> {
  @doc(Description)
  @visibility(Lifecycle.Read)
  @path
  @key(ResourceParameterName)
  @segment(ResourceType)
  @pattern(NamePattern)
  name: NameType;
}

/** An external child resource target, used when an extension targets a child resource from another provider namespace
 * @template ParentModel The parent of this resource.
 * @template ResourceType The type of this resource.
 * @template ResourceParameterName The name of the 'name' parameter of this resource.
 * @template NamePattern The pattern restriction for the name of this resource (default is none).
 * @template NameType The type of the name parameter of this resource (default is string).
 * @template Description The description of the name parameter of this resource (default is "The name of the resource").
 *
 * @example
 * \`\`\`typespec
 * alias VirtualMachine = ExternalResource<"Microsoft.Compute", "virtualMachines", "vmName">;
 *
 * \`\`\`
 *
 * @example
 * \`\`\`typespec
 * alias Scaleset = Extension.ExternalResource<
 *   "Microsoft.Compute",
 *   "virtualMachineScaleSets",
 *   "scaleSetName"
 * >;
 *
 * alias VirtualMachineScaleSetVm = Extension.ExternalChildResource<
 *   Scaleset,
 *   "virtualMachineScaleSetVms",
 *   "scaleSetVmName"
 * >;
 *
 * \`\`\`
 */
@doc("")
@parentResource(ParentModel)
@Http.Private.includeInapplicableMetadataInPayload(false)
model ExternalChildResource<
  ParentModel extends {},
  ResourceType extends valueof string,
  ResourceParameterName extends valueof string,
  NamePattern extends valueof string = "",
  NameType extends string = string,
  Description extends valueof string = "The name of the resource"
> {
  @doc(Description)
  @visibility(Lifecycle.Read)
  @path
  @key(ResourceParameterName)
  @segment(ResourceType)
  @pattern(NamePattern)
  name: NameType;
}
/** A subscription target for an extension resource */
@builtInSubscriptionResource
model Subscription {}

/** A resource group target for an extension resource */
@builtInResourceGroupResource
model ResourceGroup {}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/extension/private.decorators.tsp":`using Reflection;

namespace Azure.ResourceManager.Extension.Private;

/**
 * \`@builtInResource\` marks a model as built-in to Azure ResourceManager at the tenant level
 *
 * @param target - The model that is marked as built-in.
 */
extern dec builtInResource(target: Model);

/**
 * \`@builtInSubscriptionResource\` marks a model as built-in to Azure ResourceManager at the Subscription level
 *
 * @param target - The model that is marked as built-in.
 */
extern dec builtInSubscriptionResource(target: Model);

/**
 * \`@builtInResourceGroupResource\` marks a model as built-in to Azure ResourceManager at the ResourceGroup level
 *
 * @param target - The model that is marked as built-in.
 */
extern dec builtInResourceGroupResource(target: Model);
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/backcompat.tsp":`using Azure.ResourceManager.CommonTypes;

namespace Azure.ResourceManager;

// customer-managed-keys
alias InfrastructureEncryption = CommonTypes.InfrastructureEncryption;
alias KeyEncryptionIdentity = CommonTypes.KeyEncryptionKeyIdentity;
alias KeyEncryptionKeyIdentity = CommonTypes.KeyEncryptionKeyIdentity;
alias CustomerManagedKeyEncryption = CommonTypes.CustomerManagedKeyEncryption;
alias EncryptionConfiguration = CommonTypes.Encryption;

// private-links
alias PrivateEndpoint = CommonTypes.PrivateEndpoint;
alias PrivateEndpointConnection = CommonTypes.PrivateEndpointConnection;
alias PrivateEndpointConnectionProperties = CommonTypes.PrivateEndpointConnectionProperties;
alias PrivateLinkServiceConnectionState = CommonTypes.PrivateLinkServiceConnectionState;
alias PrivateEndpointConnectionProvisioningState = CommonTypes.PrivateEndpointConnectionProvisioningState;
alias PrivateEndpointServiceConnectionStatus = CommonTypes.PrivateEndpointServiceConnectionStatus;
alias PrivateEndpointConnectionParameter = CommonTypes.PrivateEndpointConnectionParameter;
alias PrivateLinkResource = CommonTypes.PrivateLinkResource;
alias PrivateLinkResourceProperties = CommonTypes.PrivateLinkResourceProperties;
alias PrivateLinkResourceParameter<
  Segment extends valueof string = "privateLinkResources",
  ResourceNamePattern extends valueof string = string("^[a-z][a-zA-Z0-9]*$"),
  MinLength extends valueof int32 = 3,
  MaxLength extends valueof int32 = 63
> = CommonTypes.PrivateLinkResourceNameParameter<
  Segment,
  ResourceNamePattern,
  MinLength,
  MaxLength
>;
alias PrivateEndpointConnectionResourceListResult = CommonTypes.PrivateEndpointConnectionListResult;
#suppress "deprecated" "Need for back compatibility in common-types"
alias PrivateEndpointConnectionResourceListResultV5 = CommonTypes.PrivateEndpointConnectionListResultV5;
alias PrivateLinkResourceListResult = CommonTypes.PrivateLinkResourceListResult;
#suppress "deprecated" "Need for back compatibility in common-types"
alias PrivateLinkResourceListResultV5 = CommonTypes.PrivateLinkResourceListResultV5;

// types
alias ErrorResponse = CommonTypes.ErrorResponse;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/models.tsp":`using Http;
using Rest;
using Azure.Core;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;

namespace Azure.ResourceManager;

/**
 * Spread this model into ARM resource models to specify resource name parameter for its operations. If \`Resource\` parameter
 * is specified, the resource name will be properly camel cased and pluralized for \`@key\` and \`@segment\`
 * automatically. You can also apply explicit override with \`KeyName\` and \`SegmentName\` template parameters.
 *
 * For additional decorators such as @minLength, you can use either augment decorator on \`[Resource].name\` or passing in a scalar string type with decorators.
 *
 * @template Resource The ARM resource this name parameter is applying to.
 * @template KeyName Override default key name of the resource.
 * @template SegmentName Override default segment name of the resource.
 * @template NamePattern The RegEx pattern of the name. Default is \`^[a-zA-Z0-9-]{3,24}$\`.
 * @template Type The type of the name property. Default type is string. However you can pass an union with string values.
 *
 * @example
 * \`\`\`typespec
 * model Employee is TrackedResource<EmployeeProperties> {
 *  ...ResourceNameParameter<
 *    Resource = Employee,
 *    KeyName = "employeeName",
 *    SegmentName = "employees",
 *    NamePattern = "^[^<>%&:?#/\\\\\\\\]+$"
 *  >;
 * }
 * \`\`\`
 */
model ResourceNameParameter<
  Resource extends Foundations.SimpleResource,
  KeyName extends valueof string = "",
  SegmentName extends valueof string = "",
  NamePattern extends valueof string = "^[a-zA-Z0-9-]{3,24}$",
  Type extends string = string
> {
  @doc("The name of the {name}", Resource)
  @pattern(NamePattern)
  @defaultResourceKeySegmentName(Resource, KeyName, SegmentName)
  @path
  name: Type;
}

//#region Standard Resource Operation Interfaces
/**
 * Concrete tracked resource types can be created by aliasing this type using a specific property type.
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 * @template Properties A model containing the provider-specific properties for this resource
 * @template PropertiesOptional A boolean flag indicating whether the resource \`Properties\` field is marked as optional or required. Default true is optional and recommended.
 *
 * @example
 * \`\`\`typespec
 * model Employee is TrackedResource<EmployeeProperties> {
 *  ...ResourceNameParameter<Employee>
 * }
 * \`\`\`
 */
@doc("Concrete tracked resource types can be created by aliasing this type using a specific property type.")
@armResourceInternal(Properties)
@Http.Private.includeInapplicableMetadataInPayload(false)
model TrackedResource<Properties extends {}, PropertiesOptional extends valueof boolean = true>
  extends Foundations.TrackedResource {
  @doc("The resource-specific properties for this resource.")
  @armResourcePropertiesOptionality(PropertiesOptional)
  properties?: Properties;
}

/**
 * Concrete proxy resource types can be created by aliasing this type using a specific property type.
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 * @template Properties A model containing the provider-specific properties for this resource
 * @template PropertiesOptional A boolean flag indicating whether the resource \`Properties\` field is marked as optional or required. Default true is optional and recommended.
 *
 * @example
 * \`\`\`typespec
 * model Employee is ProxyResource<EmployeeProperties> {
 *  ...ResourceNameParameter<Employee>;
 * }
 * \`\`\`
 */
@doc("Concrete proxy resource types can be created by aliasing this type using a specific property type.")
@armResourceInternal(Properties)
@Http.Private.includeInapplicableMetadataInPayload(false)
model ProxyResource<Properties extends {}, PropertiesOptional extends valueof boolean = true>
  extends Foundations.ProxyResource {
  @doc("The resource-specific properties for this resource.")
  @armResourcePropertiesOptionality(PropertiesOptional)
  properties?: Properties;
}

/**
 * Concrete extension resource types can be created by aliasing this type using a specific property type.
 *
 * See more details on [different Azure Resource Manager resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
 * @template Properties A model containing the provider-specific properties for this resource
 * @template PropertiesOptional A boolean flag indicating whether the resource \`Properties\` field is marked as optional or required. Default true is optional and recommended.
 *
 * @example
 * \`\`\`typespec
 * model PetInstance is ExtensionResource<PetProperties> {
 *  @key
 *  @path
 *  @segment("petInstances")
 *  @pattern("^[a-zA-Z0-9-]{3,24}$")
 *  @visibility(Lifecycle.Read)
 *  name: string;
 * }
 * \`\`\`
 */
@extensionResource
@doc("Concrete extension resource types can be created by aliasing this type using a specific property type.")
@armResourceInternal(Properties)
@Http.Private.includeInapplicableMetadataInPayload(false)
model ExtensionResource<Properties extends {}, PropertiesOptional extends valueof boolean = true>
  extends Foundations.ExtensionResource {
  @doc("The resource-specific properties for this resource.")
  @armResourcePropertiesOptionality(PropertiesOptional)
  properties?: Properties;
}
//#region

//#region Standard extraction models

/**
 * Extracts the key (path) parameters from a resource and its parents
 * @template Resource The resource to extract properties from
 */
@copyResourceKeyParameters
model KeysOf<Resource> {}

/**
 * Extracts the key (path) parameters from the parent(s) of the given resource
 * @template Resource The resource to extract properties from
 */
@copyResourceKeyParameters("parent")
model ParentKeysOf<Resource> {}

/**
 * Model describing the provider namespace.
 * @template Resource The resource provided by the namespace.
 */
model ProviderNamespace<Resource extends {}> {
  @path
  @segment("providers")
  @assignProviderNameValue(Resource)
  @doc("The provider namespace for the resource.")
  provider: "Microsoft.ThisWillBeReplaced";
}
//#endregion

//#region Common Azure Resource Manager type definitions

/**
 * Use Azure.Core.armResourceIdentifier<AllowedResourceTypes>
 */
#deprecated "Use Azure.Core.armResourceIdentifier<AllowedResourceTypes> instead."
alias ResourceIdentifier<AllowedResourceTypes extends ArmResourceIdentifierAllowedResource[] = never> = Azure.Core.armResourceIdentifier<AllowedResourceTypes>;

#deprecated "Use ArmResourceIdentifierAllowedResource instead."
alias ResourceIdentifierAllowedResource = ArmResourceIdentifierAllowedResource;

/**
 * Standard terminal provisioning state of resource type. You can include in your
 * custom provision state to avoid duplication and ensure consistency
 *
 * @example
 *
 * \`\`\`typespec
 * union FooProvisioningState {
 *   ResourceProvisioningState,  // include standard provisioning states
 *   starting: "starting",
 *   started: "started",
 *   stopping: "stopping",
 *   stopped: "stopped",
 * }
 * \`\`\`
 */
@doc("The provisioning state of a resource type.")
@Azure.Core.lroStatus
union ResourceProvisioningState {
  @doc("Resource has been created.")
  Succeeded: "Succeeded",

  @doc("Resource creation failed.")
  Failed: "Failed",

  @doc("Resource creation was canceled.")
  Canceled: "Canceled",

  string,
}

/**
 * Standard resource provisioning state model. If you do not have any custom provisioning state,
 * you can spread this model directly into your resource property model.
 *
 * @example
 *
 * \`\`\`typespec
 * model FooProperties {
 *   // Only have standard Succeeded, Failed, Cancelled states
 *   ...DefaultProvisioningStateProperty,
 * }
 * \`\`\`
 */
@doc("Contains a default provisioningState property to be spread into resource property types")
model DefaultProvisioningStateProperty {
  @doc("The provisioning state of the resource.")
  @visibility(Lifecycle.Read)
  provisioningState?: ResourceProvisioningState;
}

/**
 * Model representing the standard \`extendedLocation\` envelope property for a resource.
 * Spread this model into a Resource Model, if the resource supports extended locations
 *
 * @example
 * \`\`\`typespec
 * model Employee is TrackedResource<EmployeeProperties> {
 * ...ResourceNameParameter<Employee>;
 * ...ExtendedLocationProperty;
 * }
 * \`\`\`
 */
model ExtendedLocationProperty {
  @visibility(Lifecycle.Read, Lifecycle.Create)
  extendedLocation?: Foundations.ExtendedLocation;
}

#deprecated "Please change ManagedServiceIdentity to ManagedServiceIdentityProperty."
alias ManagedServiceIdentity = ManagedServiceIdentityProperty;

/**
 * Model representing the standard \`ManagedServiceIdentity\` envelope property for a resource.
 * Spread this model into a resource model if the resource supports both system-assigned and user-assigned managed identities.
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   ...ResourceNameParameter<Foo>;
 *   ...ManagedServiceIdentityProperty;
 * }
 * \`\`\`
 */
@doc("The managed service identities envelope.")
model ManagedServiceIdentityProperty {
  @doc("The managed service identities assigned to this resource.")
  identity?: Foundations.ManagedServiceIdentity;
}

#deprecated "Please change ManagedSystemAssignedIdentity to ManagedSystemAssignedIdentityProperty."
alias ManagedSystemAssignedIdentity = ManagedSystemAssignedIdentityProperty;
/**
 * Model representing the standard \`SystemAssignedServiceIdentity\` envelope property for a resource.
 * Spread this model into a resource model if the resource supports system-assigned managed identities
 * but does not support user-assigned managed identities.
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   ...ResourceNameParameter<Foo>;
 *   ...ManagedSystemAssignedIdentityProperty;
 * }
 * \`\`\`
 */
@doc("Managed identity for services that are constrained to system-assigned managed identities.")
model ManagedSystemAssignedIdentityProperty {
  @doc("The managed service identities assigned to this resource.")
  identity?: Foundations.SystemAssignedServiceIdentity;
}

#deprecated "\`EntityTag\` will be deprecated. Please use \`EntityTagProperty\` instead."
alias EntityTag = EntityTagProperty;
/**
 * Model used only to spread in the standard \`eTag\` envelope property for a resource
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   // Only have standard Succeeded, Failed, Cancelled states
 *   ...EntityTagProperty;
 * }
 * \`\`\`
 */
@doc("The eTag property envelope.")
model EntityTagProperty {
  @doc("If eTag is provided in the response body, it may also be provided as a header per the normal etag convention.  Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.")
  @visibility(Lifecycle.Read)
  eTag?: string;
}

#deprecated "\`ResourceKind\` will be deprecated. Please use \`ResourceKindProperty\` instead."
alias ResourceKind = ResourceKindProperty;
/**
 * Model representing the standard \`kind\` envelope property for a resource.
 * Spread this model into a resource model if the resource support ARM \`kind\`.
 * @template Type The type of the kind property. Default is string. However you can pass a union with string values.
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   // Only have standard Succeeded, Failed, Cancelled states
 *   ...ResourceKindProperty;
 * }
 * \`\`\`
 */
@doc("The resource kind property envelope.")
model ResourceKindProperty<Type extends string = string> {
  @doc("Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type.  If supported, the resource provider must validate and persist this value.")
  @pattern("^[-\\\\w\\\\._,\\\\(\\\\\\\\\\\\)]+$")
  @visibility(Lifecycle.Read, Lifecycle.Create)
  kind?: Type;
}

/**
 * Paged response containing resources
 * @template Resource The type of the values returned in the paged response (must be a resource)
 *
 * @example
 * \`\`\`typespec
 * op list is ArmResourceActionSync<
 *  Resource = Employee,
 *  Request = void,
 *  Response = ResourceListResult<Employee>
 * >;
 * \`\`\`
 */
@doc("The response of a {name} list operation.", Resource)
@friendlyName("{name}ListResult", Resource)
model ResourceListResult<Resource extends Foundations.SimpleResource> is Azure.Core.Page<Resource>;

/**
 * Paged response containing results
 * @template Result The type of the values returned in the paged response
 */
@doc("The custom response of a list operation.")
@friendlyName("{name}ListResult", Result)
model ResourceListCustomResult<Result> {
  /** The items on this page */
  @pageItems
  value: Result[];

  /** The link to the next page of items */
  @nextLink
  nextLink?: string;
}

#deprecated "\`ResourcePlan\` will be deprecated. Please use \`ResourcePlanProperty\` instead."
alias ResourcePlan = ResourcePlanProperty;
/**
 * Model representing the standard \`plan\` envelope property for a resource.
 * Spread this model into a resource Model if the resource supports ARM \`plan\`.
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   // Only have standard Succeeded, Failed, Cancelled states
 *   ...ResourcePlanProperty;
 * }
 * \`\`\`
 */
@doc("The resource plan property envelope.")
model ResourcePlanProperty {
  @doc("Details of the resource plan.")
  plan?: Plan;
}

#deprecated "\`ResourceSku\` will be deprecated. Please use \`ResourceSkuProperty\` instead."
alias ResourceSku = ResourceSkuProperty;
/**
 * Model representing the standard \`sku\` envelope property for a resource.
 * Spread this model into a resource model if the resource supports standard ARM \`sku\`.
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   // Only have standard Succeeded, Failed, Cancelled states
 *   ...ResourceSkuProperty;
 * }
 * \`\`\`
 */
@doc("The SKU (Stock Keeping Unit) assigned to this resource.")
model ResourceSkuProperty {
  @doc("The SKU (Stock Keeping Unit) assigned to this resource.")
  sku?: Sku;
}

#deprecated "\`ManagedBy\` will be deprecated. Please use \`ManagedByProperty\` instead."
alias ManagedBy = ManagedByProperty;
/**
 * Model representing the standard \`managedBy\` envelope property for a resource.
 * Spread this model into a resource model if the resource is managed by another entity.
 *
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   // Only have standard Succeeded, Failed, Cancelled states
 *   ...ManagedByProperty;
 * }
 * \`\`\`
 */
@doc("The managedBy property envelope.")
model ManagedByProperty {
  @doc("The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource.")
  managedBy?: string;
}

/** Please use the spread model EncryptionProperty */
alias Encryption = EncryptionProperty;
/**
 * Model used only to spread in the \`encryption\` envelope property for a resource.
 * @example
 *
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *   ...Encryption;
 * }
 * \`\`\`
 */
/** All encryption configuration for a resource. */
model EncryptionProperty {
  /** All encryption configuration for a resource. */
  encryption: EncryptionConfiguration;
}

/**
 * Model representing the standard \`zones\` envelope property for a resource.
 * Spread this model into a resource Model if the resource supports ARM \`zones\`.
 *
 * @example
 * \`\`\`typespec
 * model Foo is TrackedResource<FooProperties> {
 *  ...AvailabilityZonesProperty;
 * }
 * \`\`\`
 */
model AvailabilityZonesProperty {
  /** The availability zones. */
  zones?: string[];
}

//#endregion
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/operations.tsp":`using Http;
using Rest;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;

namespace Azure.ResourceManager;

// OPERATION TEMPLATES

/**
 * A resource list operation, at the subscription scope
 * @template Resource the resource being listed
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the list operation
 * @template Error Optional. The error response, if non-standard.
 */
@autoRoute
@doc("List {name} resources by subscription ID", Resource)
@list
@listsResource(Resource)
@segmentOf(Resource)
@armResourceList(Resource)
@get
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmListBySubscription<
  Resource extends Foundations.SimpleResource,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ResourceListResult<Resource>>,
  Error extends {} = ErrorResponse
> is ArmReadOperation<SubscriptionScope<Resource> & Parameters, Response, Error>;

/**
 * A resource list operation, at the subscription scope, for any resource.
 * This template generates a standard resource list operation at the subscription level,
 * @template Resource the resource being listed
 * @template Parameters Optional. Additional query or header parameters
 * @template Response Optional. The success response for the list operation
 * @template Error Optional. The error response, if non-standard.
 */
@autoRoute
@doc("List {name} resources by subscription ID", Resource)
@list
@listsResource(Resource)
@segmentOf(Resource)
@armResourceList(Resource)
@get
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmListBySubscriptionScope<
  Resource extends Foundations.SimpleResource,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ResourceListResult<Resource>>,
  Error extends {} = ErrorResponse
> is ArmReadOperation<
  SubscriptionBaseParameters & ProviderNamespace<Resource> & Parameters,
  Response,
  Error
>;

/**
 * A resource list operation, at the scope of the resource's parent
 * @template Resource the resource being listed
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template ParentName Optional. The name of the parent resource
 * @template ParentFriendlyName Optional. The friendly name of the parent resource
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the list operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@get
@autoRoute
@list
@listsResource(Resource)
@segmentOf(Resource)
@Private.armRenameListByOperation(Resource, ParentName, ParentFriendlyName, false) // This must come before @armResourceList!
@armResourceList(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourceListByParent<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  ParentName extends valueof string = "",
  ParentFriendlyName extends valueof string = "",
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ResourceListResult<Resource>>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmReadOperation<
  ResourceParentParameters<Resource, BaseParameters, Provider> & Parameters,
  Response,
  Error
>;

/**
 * A resource list operation, with scope determined by BaseParameters
 * @template Resource the resource being listed
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the list operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@get
@autoRoute
@list
@listsResource(Resource)
@segmentOf(Resource)
@Private.armRenameListByOperation(Resource) // This must come before @armResourceList!
@armResourceList(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourceListAtScope<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<ResourceListResult<Resource>>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmReadOperation<
  ResourceParentParameters<Resource, BaseParameters, Provider> & Parameters,
  Response,
  Error
>;

/**
 * A resource GET operation
 * @template Resource the resource being read
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the read operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@doc("Get a {name}", Resource)
@get
@armResourceRead(Resource)
op ArmResourceRead<
  Resource extends {},
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<Resource>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmReadOperation<
  ResourceInstanceParameters<Resource, BaseParameters, Provider> & Parameters,
  Response,
  Error
>;

/**
 * Check a resource's existence via HEAD operation
 * @template Resource the resource being checked
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the read operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@doc("Check for the existence of a {name}", Resource)
@armResourceCheckExistence(Resource)
@head
op ArmResourceCheckExistence<
  Resource extends {},
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} = ArmResourceExistsResponse | ArmResourceNotFoundResponse,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmReadOperation<
  ResourceInstanceParameters<Resource, BaseParameters, Provider> & Parameters,
  Response,
  Error
>;

/**
 * A resource GET operation template for an Azure Resource Manager Operation Status endpoint.
 * The path is determined by the \`Scope\` parameter. Use one of the four standard scope models:
 * - \`TenantActionScope\` (default): \`GET /providers/{providerNamespace}/operationStatuses/{operationId}\`
 * - \`SubscriptionActionScope\`: \`GET /subscriptions/{subscriptionId}/providers/{providerNamespace}/operationStatuses/{operationId}\`
 * - \`TenantLocationActionScope\`: \`GET /providers/{providerNamespace}/locations/{location}/operationStatuses/{operationId}\`
 * - \`SubscriptionLocationActionScope\`: \`GET /subscriptions/{subscriptionId}/providers/{providerNamespace}/locations/{location}/operationStatuses/{operationId}\`
 *
 * @template Response The type of the response body. Defaults to ArmOperationStatus.
 * @template Scope The scope of the operation. Defaults to TenantActionScope.
 * @template Parameters Optional. Additional non-path parameters (e.g. query or header parameters).
 * @template Error Optional. The error response, if non-standard.
 */
@autoRoute
@doc("Get the status of an async operation.")
@get
@armResourceCollectionAction
@Private.armUpdateProviderNamespace
op GetResourceOperationStatus<
  Response extends {} = ArmOperationStatus,
  Scope extends {} = TenantActionScope,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse
>(
  ...Azure.ResourceManager.Foundations.DefaultBaseParameters<Scope>,
  ...ProviderNamespace<Scope>,
  ...Scope,

  @path
  @segment("operationStatuses")
  @doc("The operation ID.")
  operationId: string,

  ...Parameters,
): ArmResponse<Response> | Error;

/**
 * A long-running resource CreateOrUpdate (PUT)
 * @template Resource the resource being created or updated
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@doc("Create a {name}", Resource)
@armResourceCreateOrUpdate(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
@put
op ArmResourceCreateOrUpdateAsync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedResponse<Resource, LroHeaders>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmCreateOperation<
  ResourceInstanceParameters<Resource, BaseParameters, Provider> & Parameters,
  Resource,
  Response,
  Error
>;

/**
 * DEPRECATED: Please use ArmResourceCreateOrReplaceSync instead
 * @template Resource the resource being created or updated
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrUpdate operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
#deprecated "Please use ArmResourceCreateOrReplaceSync instead"
@autoRoute
@doc("Create a {name}", Resource)
@armResourceCreateOrUpdate(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@put
op ArmResourceCreateOrUpdateSync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<Resource>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmCreateOperation<
  ResourceInstanceParameters<Resource, BaseParameters, Provider> & Parameters,
  Resource,
  Response,
  Error
>;

/**
 * Synchronous PUT operation for Azure Resource Manager resources
 * @template Resource the resource being created or replaced
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrReplace operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@doc("Create a {name}", Resource)
@armResourceCreateOrUpdate(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@put
op ArmResourceCreateOrReplaceSync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedSyncResponse<Resource>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmCreateOperation<
  ResourceInstanceParameters<Resource, BaseParameters, Provider> & Parameters,
  Resource,
  Response,
  Error
>;

/**
 * @dev A long-running resource CreateOrUpdate (PUT)
 * @template Resource the resource being created or replaced
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the createOrReplace operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourceCreateOrReplaceAsync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResourceUpdatedResponse<Resource>
    | ArmResourceCreatedResponse<Resource, LroHeaders>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmResourceCreateOrUpdateAsync<
  Resource,
  BaseParameters,
  LroHeaders,
  Parameters,
  Response,
  Error,
  Provider
>;

/**
 * @dev A long-running resource update that only allows updating resource tags (the minimum)
 * @template Resource the resource being patched
 * @template Properties Optional. Exists for parallelism with ArmResourcePatch.
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers that appear in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Provider Optional. The provider namespace model for the resource.
 */
#suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
@patch(#{ implicitOptionality: true })
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmTagsPatchAsync<
  Resource extends Foundations.SimpleResource,
  Properties extends {} = TagsUpdateModel<Resource>,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Resource,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Provider extends {} = ProviderNamespace<Resource>
> is ArmCustomPatchAsync<
  Resource,
  TagsUpdateModel<Resource>,
  BaseParameters,
  LroHeaders,
  Parameters,
  ArmResponse<Resource> | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
  ErrorResponse,
  Provider
>;

/**
 * @dev A long-running resource update using the items from the resource marked with Lifecycle.Update visibility
 * @template Resource the resource being patched
 * @template Properties The model type of the resource properties
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Provider Optional. The provider namespace model for the resource.
 */
#suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
@patch(#{ implicitOptionality: true })
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourcePatchAsync<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Resource,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Provider extends {} = ProviderNamespace<Resource>
> is ArmCustomPatchAsync<
  Resource,
  Resource,
  BaseParameters,
  LroHeaders,
  Parameters,
  ArmResponse<Resource> | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
  ErrorResponse,
  Provider
>;

/**
 * A long-running resource update using a custom PATCH payload (Asynchronous)
 * @template Resource the resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template LroHeaders Optional.  Allows overriding the lro headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@doc("Update a {name}", Resource)
@armResourceUpdate(Resource)
@patch(#{ implicitOptionality: false })
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmCustomPatchAsync<
  Resource extends Foundations.SimpleResource,
  PatchModel extends TypeSpec.Reflection.Model = TagsUpdateModel<Resource>,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Resource,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmResponse<Resource>
    | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmUpdateOperation<
  ResourceInstanceParameters<Resource, BaseParameters, Provider> & Parameters,
  PatchModel,
  Response,
  Error
>;

/**
 * @dev A resource update that only allows updating resource tags (the minimum)
 * @template Resource the resource being patched
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Provider Optional. The provider namespace model for the resource.
 */
#suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
@patch(#{ implicitOptionality: true })
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmTagsPatchSync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Provider extends {} = ProviderNamespace<Resource>
> is ArmCustomPatchSync<
  Resource,
  TagsUpdateModel<Resource>,
  BaseParameters,
  Parameters,
  ArmResponse<Resource>,
  ErrorResponse,
  Provider
>;

/**
 * @dev A resource update using the items from the resource marked with Lifecycle.Update visibility
 * @template Resource the resource being patched
 * @template Properties The model type of the resource properties
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Provider Optional. The provider namespace model for the resource.
 */
#suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
@patch(#{ implicitOptionality: true })
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourcePatchSync<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Provider extends {} = ProviderNamespace<Resource>
> is ArmCustomPatchSync<
  Resource,
  Resource,
  BaseParameters,
  Parameters,
  ArmResponse<Resource>,
  ErrorResponse,
  Provider
>;

/**
 * A resource update using a custom PATCH payload (synchronous)
 * @template Resource the resource being patched
 * @template PatchModel The input model for the PATCH request
 * @template BaseParameters Optional. Allows overriding the operation parameters
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response for the patch operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@doc("Update a {name}", Resource)
@armResourceUpdate(Resource)
@patch(#{ implicitOptionality: false })
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmCustomPatchSync<
  Resource extends Foundations.SimpleResource,
  PatchModel extends TypeSpec.Reflection.Model = TagsUpdateModel<Resource>,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} = ArmResponse<Resource>,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmUpdateOperation<
  ResourceInstanceParameters<Resource, BaseParameters, Provider> & Parameters,
  PatchModel,
  Response,
  Error
>;

/**
 * @dev Delete a resource asynchronously
 * @template Resource The resource being deleted
 * @template Response The response type for the operation
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@doc("Delete a {name}", Resource)
@armResourceDelete(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@delete
op ArmResourceDeleteAsyncBase<
  Resource extends Foundations.SimpleResource,
  Response,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
>(...ResourceInstanceParameters<Resource, BaseParameters, Provider>, ...Parameters):
  | Response
  | Error;

/**
 * @dev Delete a resource asynchronously.  DEPRECATED: Use ArmResourceDeleteWithoutOkAsync instead
 * @template Resource The resource being deleted
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template LroHeaders Optional. Allows overriding the headers in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response(s) for the delete operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
#deprecated "Use 'ArmResourceDeleteWithoutOkAsync' instead"
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourceDeleteAsync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} =
    | ArmDeletedResponse
    | ArmDeleteAcceptedLroResponse<LroHeaders>
    | ArmDeletedNoContentResponse,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmResourceDeleteAsyncBase<Resource, Response, BaseParameters, Parameters, Error, Provider>;

/**
 * @dev Delete a resource asynchronously
 * @template Resource The resource being deleted
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response(s) for the delete operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourceDeleteWithoutOkAsync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<FinalResult = void> &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Response extends {} = ArmDeleteAcceptedLroResponse<LroHeaders> | ArmDeletedNoContentResponse,
  Error extends {} = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmResourceDeleteAsyncBase<Resource, Response, BaseParameters, Parameters, Error, Provider>;

/**
 * Delete a resource synchronously
 * @template Resource The resource being deleted
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Response Optional. The success response(s) for the delete operation
 * @template Error Optional. The error response, if non-standard.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@doc("Delete a {name}", Resource)
@armResourceDelete(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@delete
op ArmResourceDeleteSync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Response extends {} = ArmDeletedResponse | ArmDeletedNoContentResponse,
  Error = ErrorResponse,
  Provider extends {} = ProviderNamespace<Resource>
>(...ResourceInstanceParameters<Resource, BaseParameters, Provider>, ...Parameters):
  | Response
  | Error;

/**
 * A long-running resource action.
 * @template Resource The resource being acted upon
 * @template Request The request model for the action
 * @template Response The response type for the action
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@armResourceAction(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@post
op ArmResourceActionAsyncBase<
  Resource extends Foundations.SimpleResource,
  Request,
  Response extends TypeSpec.Reflection.Model | unknown | void,
  BaseParameters extends TypeSpec.Reflection.Model,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Provider extends {} = ProviderNamespace<Resource>
>(
  ...ResourceInstanceParameters<Resource, BaseParameters, Provider>,
  ...Parameters,

  @doc("The content of the action request")
  @armBodyRoot(OptionalRequestBody)
  body: Request,
): Response | Error;

/**
 * @dev A long-running resource action.
 * @template Resource The resource being acted upon
 * @template Request The request model for the action
 * @template Response The response model for the action
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the body parameter is optional.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@returnsDoc("Azure operation completed successfully.")
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourceActionAsync<
  Resource extends Foundations.SimpleResource,
  Request,
  Response extends TypeSpec.Reflection.Model | unknown | void,
  BaseParameters extends TypeSpec.Reflection.Model = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Response,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmResourceActionAsyncBase<
  Resource,
  Request,
  ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders> | Response,
  BaseParameters,
  Parameters,
  Error,
  OptionalRequestBody,
  Provider
>;

/**
 * @dev The *standard*  long-running resource action.
 * @template Resource The resource being acted upon
 * @template Request The request model for the action
 * @template Response The response model for the action, returned after polling the long-running operation
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the body parameter is optional.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@returnsDoc("Azure operation completed successfully.")
@Private.enforceConstraint(Resource, Foundations.Resource)
op ActionAsync<
  Resource extends Foundations.SimpleResource,
  Request,
  Response extends TypeSpec.Reflection.Model | unknown | void,
  BaseParameters extends TypeSpec.Reflection.Model = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Response,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmResourceActionAsyncBase<
  Resource,
  Request,
  ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>,
  BaseParameters,
  Parameters,
  Error,
  OptionalRequestBody,
  Provider
>;

/**
 * A synchronous resource action.
 * @template Resource The resource being acted upon
 * @template Request The request model for the action
 * @template Response The response model for the action
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the body parameter is optional.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@armResourceAction(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@post
@returnsDoc("Azure operation completed successfully.")
op ArmResourceActionSync<
  Resource extends Foundations.SimpleResource,
  Request,
  Response,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Provider extends {} = ProviderNamespace<Resource>
>(
  ...ResourceInstanceParameters<Resource, BaseParameters, Provider>,
  ...Parameters,

  @doc("The content of the action request")
  @armBodyRoot(OptionalRequestBody)
  body: Request,
): Response | Error;

/**
 * @dev A long-running resource action that returns no content. DEPRECATED: Use 'ArmResourceActionNoResponseContentAsync' instead
 * @template Resource The resource being acted upon
 * @template Request The request model for the action
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the body parameter is optional.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourceActionNoContentAsync<
  Resource extends Foundations.SimpleResource,
  Request extends TypeSpec.Reflection.Model | void,
  BaseParameters extends TypeSpec.Reflection.Model = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmResourceActionAsyncBase<
  Resource,
  Request,

    | ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>
    | ArmNoContentResponse<"Action completed successfully.">,
  BaseParameters,
  Parameters,
  Error,
  OptionalRequestBody,
  Provider
>;

/**
 * @dev A long-running resource action that returns no content.
 * @template Resource The resource being acted upon
 * @template Request The request model for the action
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the body parameter is optional.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@Private.enforceConstraint(Resource, Foundations.Resource)
op ArmResourceActionNoResponseContentAsync<
  Resource extends Foundations.SimpleResource,
  Request,
  BaseParameters extends TypeSpec.Reflection.Model = DefaultBaseParameters<Resource>,
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    void,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Provider extends {} = ProviderNamespace<Resource>
> is ArmResourceActionAsyncBase<
  Resource,
  Request,
  ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>,
  BaseParameters,
  Parameters,
  Error,
  OptionalRequestBody,
  Provider
>;

/**
 * A synchronous resource action that returns no content.
 * @template Resource The resource being acted upon
 * @template Request The request model for the action
 * @template BaseParameters Optional. Allows overriding the parameters for the operation
 * @template Parameters Optional. Additional parameters after the path parameters
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 * @template Provider Optional. The provider namespace model for the resource.
 */
@autoRoute
@armResourceAction(Resource)
@Private.enforceConstraint(Resource, Foundations.Resource)
@post
op ArmResourceActionNoContentSync<
  Resource extends Foundations.SimpleResource,
  Request,
  BaseParameters = DefaultBaseParameters<Resource>,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false,
  Provider extends {} = ProviderNamespace<Resource>
>(
  ...ResourceInstanceParameters<Resource, BaseParameters, Provider>,
  ...Parameters,

  @doc("The content of the action request")
  @armBodyRoot(OptionalRequestBody)
  body: Request,
): ArmNoContentResponse<"Action completed successfully."> | Error;

/**
 * @dev Adds check global name availability operation, normally used if
 * a resource name must be globally unique (for example, if the resource
 * exposes and endpoint that uses the resource name in the url)
 * @template Request the availability request, defaults to the standard request, containing name and resource type
 * @template Response the availability response, default to the standard response
 * @template AdditionalParams A model specifying additional non-path parameters to the availability request
 */
@doc("Implements global CheckNameAvailability operations")
op checkGlobalNameAvailability<
  Request extends TypeSpec.Reflection.Model = Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest,
  Response extends TypeSpec.Reflection.Model = CheckNameAvailabilityResponse,
  AdditionalParams extends TypeSpec.Reflection.Model = {}
> is checkNameAvailability<
  CommonTypes.SubscriptionIdParameter & DefaultProviderNamespace,
  Request,
  Response,
  AdditionalParams
>;

/**
 * @dev Adds check location-specific name availability operation, normally used if
 * a resource name must be globally unique (for example, if the resource
 * exposes and endpoint that uses the resource name in the url)
 * @template Request the availability request, defaults to the standard request, containing name and resource type
 * @template Response the availability response, default to the standard response
 * @template AdditionalParams A model specifying additional non-path parameters to the availability request
 */
@doc("Implements local CheckNameAvailability operations")
op checkLocalNameAvailability<
  Request extends TypeSpec.Reflection.Model = Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest,
  Response extends TypeSpec.Reflection.Model = CheckNameAvailabilityResponse,
  AdditionalParams extends TypeSpec.Reflection.Model = {}
> is checkNameAvailability<
  CommonTypes.SubscriptionIdParameter & DefaultProviderNamespace & LocationResourceParameter,
  Request,
  Response,
  AdditionalParams
>;

/**
 * @dev A provider action performed over a tenant
 * @template Request The request model for the action
 * @template Response The response type for the action
 * @template Scope The scope of the action (SubscriptionActionScope, TenantActionScope, or ExtensionResourceActionScope)
 * @template Parameters Optional. Additional parameters after the path parameters (e.g. Location)
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 */
@post
@action
@armResourceCollectionAction
@Private.armUpdateProviderNamespace
op ArmProviderActionSync<
  Request extends {} | unknown | void = void,
  Response extends {} | unknown | void = void,
  Scope extends {} = TenantActionScope,
  Parameters extends {} = {},
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
>(
  ...Azure.ResourceManager.Foundations.DefaultBaseParameters<Scope>,
  ...Scope,
  ...ProviderNamespace<Scope>,
  ...Parameters,

  /** The request body */
  @armBodyRoot(OptionalRequestBody) body: Request,
): Response | Error;

/**
 * @dev A long-running provider action.
 * @template Request The request model for the action
 * @template Response The response type for the action
 * @template Scope The scope of the action (SubscriptionActionScope, TenantActionScope, or ExtensionResourceActionScope)
 * @template Parameters Optional. Additional parameters after the path parameters (e.g. Location)
 * @template LroHeaders Optional.  Allows overriding the lro headers returned in the Accepted response
 * @template Error Optional. The error response, if non-standard.
 * @template OptionalRequestBody Optional. Indicates whether the request body is optional.
 */
@post
@action
@armResourceCollectionAction
@Private.armUpdateProviderNamespace
op ArmProviderActionAsync<
  Request extends {} | unknown | void = void,
  Response extends TypeSpec.Reflection.Model | unknown | void = void,
  Scope extends {} = TenantActionScope,
  Parameters extends {} = {},
  LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
    Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
    Response,
    string
  > &
    Azure.Core.Foundations.RetryAfterHeader,
  Error extends {} = ErrorResponse,
  OptionalRequestBody extends valueof boolean = false
>(
  ...Azure.ResourceManager.Foundations.DefaultBaseParameters<Scope>,
  ...Scope,
  ...ProviderNamespace<Scope>,
  ...Parameters,

  /** The request body */
  @armBodyRoot(OptionalRequestBody) body: Request,
): ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders> | Response | Error;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/interfaces.tsp":`using Http;
using Rest;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;

namespace Azure.ResourceManager;

/**
 * This is the interface that implements the standard Azure Resource Manager operation that returns
 * all supported RP operations. You should have exactly one declaration for each
 * Azure Resource Manager service. It implements
 *   GET "/providers/Microsoft.ContosoProviderHub/operations"
 */
interface Operations {
  /**
   * @dev List the operations for the provider.
   */
  @tag("Operations")
  @autoRoute
  @armUpdateProviderNamespace
  @doc("List the operations for the provider")
  @segment("operations")
  @get
  @list
  list(
    ...CommonTypes.ApiVersionParameter,

    @path
    @segment("providers")
    @doc("The provider namespace (this parameter will not show up in operations).")
    provider: "Microsoft.ThisWillBeReplaced",
  ): ArmResponse<OperationListResult> | ErrorResponse;
}

/**
 * @deprecated Use Azure.ResourceManager.TrackedResourceOperations instead
 * A composite interface for resources that include \`ResourceInstanceOperations<Resource, Properties>\`
 * and \`ResourceCollectionOperations<Resource>\`. It includes: \`GET\`, \`PUT\`, \`PATCH\`, \`DELETE\`, ListByParent,
 * ListBySubscription operations. The actual route depends on the resource model.
 * This is the most common API pattern for Tracked Resources to use.
 * @template Resource the ArmResource that provides these operations
 * @template Properties RP-specific property bag for the resource
 * @template BaseParameters The http parameters that are part of the request
 *
 */
#deprecated "Use Azure.ResourceManager.TrackedResourceOperations instead"
interface ResourceOperations<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model,
  BaseParameters = DefaultBaseParameters<Resource>
> extends TrackedResourceOperations<Resource, Properties, BaseParameters> {}

/**
 * A composite interface for resources that include \`ResourceInstanceOperations<Resource, Properties>\`
 * and \`ResourceCollectionOperations<Resource>\`. It includes: \`GET\`, \`PUT\`, \`PATCH\`, \`DELETE\`, ListByParent,
 * ListBySubscription operations. The actual route depends on the resource model.
 * This is the most common API pattern for Tracked Resources to use.
 * @template Resource the ArmResource that provides these operations
 * @template Properties RP-specific property bag for the resource
 * @template BaseParameters The http parameters that are part of the request
 *
 */
interface TrackedResourceOperations<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model,
  BaseParameters = DefaultBaseParameters<Resource>
>
  extends ResourceInstanceOperations<Resource, Properties, BaseParameters>,
    ResourceCollectionOperations<Resource, BaseParameters> {}

/**
 * A composite interface for Proxy resources that include \`ResourceInstanceOperations<Resource, Properties>\`
 * and \`ResourceListByParent<Resource>\`. It includes: \`GET\`, \`PUT\`, \`PATCH\`, \`DELETE\`, ListByParent operations.
 *
 * The actual route depends on the resource model but would have started with
 *   \`/subscriptions/{id}/resourcegroups/{rg}/providers/Microsoft.XXX/...\`
 *
 * This is the most common API pattern for Proxy Resources to use.
 * @template Resource the ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 */
#suppress "deprecated" "This should be deprecated in a future release"
interface ProxyResourceOperations<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
>
  extends ResourceRead<Resource, BaseParameters>,
    ResourceCreate<Resource, BaseParameters>,
    ResourceDelete<Resource, BaseParameters>,
    ResourceListByParent<Resource, BaseParameters> {}

/**
 * A composite interface for Tenant resources that include \`ResourceInstanceOperations<Resource, Properties>\`
 * and \`ResourceListByParent<Resource>\`. It includes: \`GET\`, \`PUT\`, \`PATCH\`, \`DELETE\`, ListByParent operations.
 *
 * The routes are always start at root level:
 *   \`/providers/Microsoft.XXX/...\`
 *
 * This is the most common API pattern for Tenant Resources to use.
 * @template Resource the ArmResource that provides these operations
 * @template Properties RP-specific property bag for the resource
 */
#suppress "deprecated" "This should be deprecated in a future release"
interface TenantResourceOperations<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
>
  extends TenantResourceRead<Resource>,
    TenantResourceCreate<Resource>,
    TenantResourceUpdate<Resource, Properties>,
    TenantResourceDelete<Resource>,
    TenantResourceListByParent<Resource> {}

/**
 * A composite interface for resources that have CRUD operations.
 * @template Resource The ArmResource that provides these operations
 * @template Properties RP-specific property bag for the resource
 * @template BaseParameters The http parameters that are part of the request
 * @template PatchModel The model used for PATCH operations
 */
#suppress "deprecated" "This should be deprecated in a future release"
interface ResourceInstanceOperations<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model,
  BaseParameters = DefaultBaseParameters<Resource>,
  PatchModel = ResourceUpdateModel<Resource, Properties>
>
  extends ResourceRead<Resource, BaseParameters>,
    ResourceCreate<Resource, BaseParameters>,
    ResourceUpdate<Resource, Properties, BaseParameters>,
    ResourceDelete<Resource, BaseParameters> {}

/**
 * A composite interface for resource collections.
 * @template Resource The ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 */
interface ResourceCollectionOperations<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> extends ResourceListByParent<Resource, BaseParameters>, ResourceListBySubscription<Resource> {}

/**
 * An interface for resources with can be listed by subscription.
 * @template Resource The ArmResource that provides these operations
 */
interface ResourceListBySubscription<Resource extends Foundations.SimpleResource> {
  /**
   * @dev List resources by subscription.
   * @template Resource The ArmResource to list.
   */
  listBySubscription is ArmListBySubscription<Resource>;
}

/**
 * An interface for resources which can be listed by parent.
 * @template Resource The ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 * @template ParentName The name of the parent resource
 * @template ParentFriendlyName The friendly name of the parent resource
 */
interface ResourceListByParent<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>,
  ParentName extends valueof string = "",
  ParentFriendlyName extends valueof string = ""
> {
  /**
   * @dev List resources by parent.
   * @template Resource The ArmResource to list.
   * @template BaseParameters The http parameters that are part of the request
   * @template ParentName The name of the parent resource
   * @template ParentFriendlyName The friendly name of the parent resource
   */
  @Private.armRenameListByOperation(Resource, ParentName, ParentFriendlyName, true) // This must come before @armResourceList!
  listByParent is ArmResourceListByParent<Resource, BaseParameters, ParentName, ParentFriendlyName>;
}

/**
 * A composite interface for resources that include a GET operation.
 * @template Resource The ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 */
interface ResourceRead<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> {
  /**
   * @dev Retrieve a resource.
   * @template Resource The ArmResource to retrieve.
   * @template BaseParameters The http parameters that are part of the request
   */
  get is ArmResourceRead<Resource, BaseParameters>;
}

/**
 * A composite interface for resources that include a synchronous create or update operation.
 * @template Resource The ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 */
interface ResourceCreateSync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> {
  /**
   * @dev Create or update a resource using the synchronous call pattern.
   * @template Resource The ArmResource to create or update.
   * @template BaseParameters The http parameters that are part of the request
   */
  createOrUpdate is ArmResourceCreateOrReplaceSync<Resource, BaseParameters>;
}

/**
 * A composite interface for resources that include a long-running create or update operation.
 * @template Resource The ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 */
interface ResourceCreateAsync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> {
  /**
   * @dev Create or update a resource using the asynchronous call pattern.
   * @template Resource The ArmResource to create or update.
   * @template BaseParameters The http parameters that are part of the request
   */
  createOrUpdate is ArmResourceCreateOrUpdateAsync<Resource, BaseParameters>;
}

/**
 * @dev A composite interface for resources that include a long-running delete operation.
 *      DEPRECATED: Use ResourceDeleteWithoutOkAsync instead
 * @template Resource The ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 */
#deprecated "This should be deprecated in a future release"
@doc("Delete a resource using the asynchronous call pattern")
interface ResourceDeleteAsync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> {
  /**
   * @dev Delete a resource using the asynchronous call pattern.
   * @template Resource The ArmResource to delete.
   * @template BaseParameters The http parameters that are part of the request
   */
  delete is ArmResourceDeleteAsync<Resource, BaseParameters>;
}

/**
 * @dev A composite interface for resources that include a synchronous delete operation.
 * @template Resource The ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 */
@doc("Delete a resource using the asynchronous call pattern")
interface ResourceDeleteWithoutOkAsync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> {
  /**
   * @dev Delete a resource using the asynchronous call pattern.
   * @template Resource The ArmResource to delete.
   * @template BaseParameters The http parameters that are part of the request
   */
  delete is ArmResourceDeleteWithoutOkAsync<Resource, BaseParameters>;
}

/**
 * A composite interface for resources that include a synchronous delete operation.
 * @template Resource The ArmResource that provides these operations
 * @template BaseParameters The http parameters that are part of the request
 */
@doc("Delete a resource")
interface ResourceDeleteSync<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> {
  /**
   * @dev Delete a resource using the synchronous call pattern.
   * @template Resource The ArmResource to delete.
   * @template BaseParameters The http parameters that are part of the request
   */
  delete is ArmResourceDeleteSync<Resource, BaseParameters>;
}

/**
 * @dev A composite interface for resources that include a long-running update operation.
 * @template Resource The ArmResource that provides these operations
 * @template Properties RP-specific property bag for the resource
 * @template BaseParameters The http parameters that are part of the request
 */
@doc("Asynchronous resource update")
interface ResourceUpdateAsync<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model,
  BaseParameters = DefaultBaseParameters<Resource>
> {
  /**
   * @dev Update a resource using the asynchronous call pattern.
   * @template Resource The ArmResource to update.
   * @template Properties RP-specific property bag for the resource
   * @template BaseParameters The http parameters that are part of the request
   */
  update is ArmCustomPatchAsync<
    Resource,
    ResourceUpdateModel<Resource, Properties>,
    BaseParameters
  >;
}

/**
 * A composite interface for resources that include a synchronous update operation.
 * @template Resource The ArmResource that provides these operations
 * @template Properties RP-specific property bag for the resource
 * @template BaseParameters The http parameters that are part of the request
 */
@doc("Synchronous resource update")
interface ResourceUpdateSync<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model,
  BaseParameters = DefaultBaseParameters<Resource>
> {
  /**
   * @dev Update a resource using the synchronous call pattern.
   * @template Resource The ArmResource to update.
   * @template Properties RP-specific property bag for the resource
   * @template BaseParameters The http parameters that are part of the request
   */
  #suppress "@typespec/http/deprecated-implicit-optionality" "Legacy"
  @patch(#{ implicitOptionality: true })
  update is ArmCustomPatchSync<Resource, ResourceUpdateModel<Resource, Properties>, BaseParameters>;
}

/**
 * A composite interface for resources that includes CRUD operations.
 * @template Resource The ArmResource that provides these operations
 * @template Properties RP-specific property bag for the resource
 */
#suppress "deprecated" "This should be deprecated in a future release"
interface ExtensionResourceInstanceOperations<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
>
  extends ExtensionResourceRead<Resource>,
    ExtensionResourceCreate<Resource>,
    ExtensionResourceUpdate<Resource, Properties>,
    ExtensionResourceDelete<Resource> {}

/**
 * A composite interface for resource collections that include a paginated list operation.
 * @template Resource The ArmResource that provides these operations
 */
interface ExtensionResourceCollectionOperations<Resource extends Foundations.SimpleResource>
  extends ExtensionResourceList<Resource> {}

/**
 * A composite interface for resources that include CRUD and list operations.
 * @template Resource The ArmResource that provides these operations
 * @template Properties RP-specific property bag for the resource
 */
interface ExtensionResourceOperations<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
>
  extends ExtensionResourceInstanceOperations<Resource, Properties>,
    ExtensionResourceCollectionOperations<Resource> {}

alias ResourceCreate<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> = ResourceCreateAsync<Resource, BaseParameters>;

alias ResourceUpdate<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model,
  BaseParameters = DefaultBaseParameters<Resource>
> = ResourceUpdateSync<Resource, Properties, BaseParameters>;

#suppress "deprecated" "This should be deprecated in a future release"
alias ResourceDelete<
  Resource extends Foundations.SimpleResource,
  BaseParameters = DefaultBaseParameters<Resource>
> = ResourceDeleteAsync<Resource, BaseParameters>;

alias ProxyResourceUpdate<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
> = ResourceUpdate<Resource, Properties>;

alias ExtensionResourceRead<Resource extends Foundations.SimpleResource> = ResourceRead<
  Resource,
  ExtensionBaseParameters
>;

alias ExtensionResourceCreate<Resource extends Foundations.SimpleResource> = ResourceCreate<
  Resource,
  ExtensionBaseParameters
>;

alias ExtensionResourceUpdate<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
> = ResourceUpdate<Resource, Properties, ExtensionBaseParameters>;

#suppress "deprecated" "This should be deprecated in a future release"
alias ExtensionResourceDelete<Resource extends Foundations.SimpleResource> = ResourceDelete<
  Resource,
  ExtensionBaseParameters
>;

alias ExtensionResourceList<Resource extends Foundations.SimpleResource> = ResourceListByParent<
  Resource,
  ExtensionBaseParameters,
  "Extension",
  "parent"
>;

alias TenantResourceRead<Resource extends Foundations.SimpleResource> = ResourceRead<
  Resource,
  TenantBaseParameters
>;

alias TenantResourceCreate<Resource extends Foundations.SimpleResource> = ResourceCreateAsync<
  Resource,
  TenantBaseParameters
>;

#suppress "deprecated" "This should be deprecated in a future release"
alias TenantResourceDelete<Resource extends Foundations.SimpleResource> = ResourceDelete<
  Resource,
  TenantBaseParameters
>;

alias TenantResourceUpdate<
  Resource extends Foundations.SimpleResource,
  Properties extends TypeSpec.Reflection.Model
> = ResourceUpdate<Resource, Properties, TenantBaseParameters>;

alias TenantResourceListByParent<Resource extends Foundations.SimpleResource> = ResourceListByParent<
  Resource,
  TenantBaseParameters,
  "Tenant",
  "tenant"
>;
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/private-endpoints.tsp":`using Http;
using Rest;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;

namespace Azure.ResourceManager;

/**
 * A private endpoint connection resource.
 * Resource providers must declare a private endpoint connection resource type in their provider namespace if
 * they support private endpoint connections
 * @template Description Optional. The documentary description of the private endpoint connection resource name parameter.
 *
 * @example
 * \`\`\`ts
 * namespace Microsoft.Contoso;
 * model PrivateEndpointConnection is PrivateEndpointConnectionResource {}
 * alias EmployeeConnectionOps is PrivateEndpoints<PrivateEndpointConnection>;
 * @armResourceOperations
 * interface Employees {
 *  @doc("get a private endpoint connection for resource employee")
 *  getPrivateEndpointConnection is EmployeeConnectionOps.Read<Employee>;
 * }
 * \`\`\`
 */
@doc(Description)
@armResourceWithParameter(
  CommonTypes.PrivateEndpointConnectionProperties,
  "privateEndpointConnections",
  "privateEndpointConnectionName"
)
@Http.Private.includeInapplicableMetadataInPayload(false)
model PrivateEndpointConnectionResource<Description extends valueof string = "A private endpoint connection resource">
  is CommonTypes.PrivateEndpointConnection;

/**
 * Operations over private endpoint connection resources.
 * @template PrivateEndpointResource The type of the private endpoint connection resource. You must declare a private endpoint connection resource type in your provider namespace.
 * @template ResourceName Optional. The name of the private endpoint connection resource in this context, by default, this is \`{targetResourceName}PrivateEndpointConnection\`.
 * @template ResourceParameter Optional. The name parameter model for the private endpoint connection resource. By default, this parameter has no constraints
 * @example
 * \`\`\`ts
 * namespace Microsoft.Contoso;
 * model PrivateEndpointConnection is PrivateEndpointConnectionResource {}
 * alias EmployeeConnectionOps is PrivateEndpoints<PrivateEndpointConnection>;
 * @armResourceOperations
 * interface Employees {
 *  @doc("get a private endpoint connection for resource employee")
 *  getPrivateEndpointConnection is EmployeeConnectionOps.Read<Employee>;
 * }
 * \`\`\`
 */
interface PrivateEndpoints<
  PrivateEndpointResource extends PrivateEndpointConnectionResource,
  ResourceName extends valueof string = string(""),
  ResourceParameter extends {} = CommonTypes.PrivateEndpointConnectionParameter
> {
  /**
   * @dev List the private endpoint connections over a resource
   * @template ParentResource the parent resource of the PrivateEndpointConnection
   * @template Resource Optional. The PrivateEndpointConnection resource being listed
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template ParentName Optional. The name of the parent resource
   * @template ParentFriendlyName Optional. The friendly name of the parent resource
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the list operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @doc("List {name} PrivateEndpointConnections", ParentResource)
  @get
  @autoRoute
  @list
  @listsResource(Resource)
  @segmentOf(ResourceParameter)
  @builtInResourceOperation(ParentResource, Resource, "list", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  ListByParent<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmReadOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> & Parameters,
    Response,
    Error
  >;

  /**
   * @dev GET the a private endpoint connection for a particular resource
   * @template ParentResource the parent resource of the PrivateEndpointConnection
   * @template Resource the PrivateEndpointConnection resource being read
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the read operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Get a {name} PrivateEndpointConnection", ParentResource)
  @get
  @builtInResourceOperation(ParentResource, Resource, "read", OverrideResourceName)
  Read<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<Resource>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmReadOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> &
      KeysOf<ResourceParameter> &
      Parameters,
    Response,
    Error
  >;

  /**
   * @dev A long-running resource CreateOrUpdate (PUT) for a PrivateEndpointConnection to a resource
   * @template ParentResource the parent resource of the PrivateEndpointConnection
   * @template Resource the PrivateEndpointConnection resource being created or updated
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the createOrUpdate operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Create a {name} PrivateEndpointConnection", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "createOrUpdate", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  @Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
  @put
  CreateOrUpdateAsync<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResourceUpdatedResponse<Resource>
      | ArmResourceCreatedResponse<Resource, LroHeaders>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmCreateOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> &
      KeysOf<ResourceParameter> &
      Parameters,
    Resource,
    Response,
    Error
  >;

  /**
   * @dev Synchronous PUT operation for a Private endpoint connection to a resource
   * @template ParentResource the parent resource of the PrivateEndpointConnection
   * @template Resource the PrivateEndpointConnection resource being created or updated
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the createOrUpdate operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Create a {name} PrivateEndpointConnection", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "createOrUpdate", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  @put
  CreateOrReplaceSync<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResourceUpdatedResponse<Resource>
      | ArmResourceCreatedSyncResponse<Resource>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmCreateOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> &
      KeysOf<ResourceParameter> &
      Parameters,
    Resource,
    Response,
    Error
  >;

  /**
   * @dev A long-running resource CreateOrUpdate (PUT) for a PrivateEndpointConnection to a resource
   * @template ParentResource the parent resource of the PrivateEndpointConnection
   * @template Resource the PrivateEndpointConnection resource being created or updated
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template LroHeaders Optional.  Allows overriding the lro headers returned on resource create
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the createOrReplace operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Create a {name} PrivateEndpointConnection", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "createOrUpdate", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  @put
  CreateOrReplaceAsync<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResourceUpdatedResponse<Resource>
      | ArmResourceCreatedResponse<Resource, LroHeaders>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmCreateOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> &
      KeysOf<ResourceParameter> &
      Parameters,
    Resource,
    Response,
    Error
  >;

  /**
   * A long-running resource update using a custom PATCH payload (Asynchronous) to update a PrivateEndpointConnection to a resource.
   * @template ParentResource the parent resource of the PrivateEndpointConnection
   * @template Resource the PrivateEndpointConnection resource being updated
   * @template PatchModel The input model for the PATCH request
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template LroHeaders Optional.  Allows overriding the lro headers returned in the Accepted response
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the patch operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Update a {name} PrivateEndpointConnection", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "update", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  @patch(#{ implicitOptionality: false })
  CustomPatchAsync<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    PatchModel extends TypeSpec.Reflection.Model = PrivateEndpointConnectionUpdate,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
      Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
      Resource,
      string
    > &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} =
      | ArmResponse<Resource>
      | ArmAcceptedLroResponse<"Resource update request accepted.", LroHeaders>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmUpdateOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> &
      KeysOf<ResourceParameter> &
      Parameters,
    PatchModel,
    Response,
    Error
  >;

  /**
   * @dev A resource update using a custom PATCH payload (synchronous) to update a PrivateEndpointConnection to a resource
   * @template ParentResource The parent resource of the PrivateEndpointConnection
   * @template Resource Optional. The PrivateEndpointConnection resource being patched
   * @template PatchModel The input model for the PATCH request
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the patch operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Update a {name} PrivateEndpointConnection", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "update", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  @patch(#{ implicitOptionality: false })
  CustomPatchSync<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    PatchModel extends TypeSpec.Reflection.Model = PrivateEndpointConnectionUpdate,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<Resource>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmUpdateOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> &
      KeysOf<ResourceParameter> &
      Parameters,
    PatchModel,
    Response,
    Error
  >;

  /**
   * @dev Delete a PrivateEndpointConnection to a resource asynchronously
   * @template ParentResource The parent resource of the PrivateEndpointConnection
   * @template Resource Optional. The PrivateEndpointConnection resource being deleted
   * @template BaseParameters Optional. Allows overriding the parameters for the operation
   * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the delete operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Delete a {name} PrivateEndpointConnection", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "delete", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  @delete
  DeleteAsync<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
      Azure.Core.Foundations.RetryAfterHeader,
    Parameters extends {} = {},
    Response extends {} = ArmDeleteAcceptedLroResponse<LroHeaders> | ArmDeletedNoContentResponse,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...ResourceInstanceParameters<ParentResource, BaseParameters>,
    ...KeysOf<ResourceParameter>,
    ...Parameters,
  ): Response | Error;

  /**
   * @dev Delete a PrivateEndpointConnection to a resource synchronously
   * @template ParentResource The parent resource of the PrivateEndpointConnection
   * @template Resource The PrivateEndpointConnection resource being deleted
   * @template BaseParameters Optional. Allows overriding the parameters for the operation
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response(s) for the delete operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Delete a {name} PrivateEndpointConnection", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "delete", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  @delete
  DeleteSync<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmDeletedResponse | ArmDeletedNoContentResponse,
    Error = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...ResourceInstanceParameters<ParentResource, BaseParameters>,
    ...KeysOf<ResourceParameter>,
    ...Parameters,
  ): Response | Error;

  /**
   * @dev Delete a PrivateEndpointConnection to a resource asynchronously
   * @template ParentResource The parent resource of the PrivateEndpointConnection
   * @template Response The response type for the operation
   * @template Resource Optional. The PrivateEndpointConnection resource being deleted
   * @template BaseParameters Optional. Allows overriding the parameters for the operation
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private endpoint connection resource being operated on.
   */
  @autoRoute
  @doc("Delete a {name} PrivateEndpointConnection", ParentResource)
  @builtInResourceOperation(ParentResource, Resource, "delete", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  @delete
  DeleteAsyncBase<
    ParentResource extends Foundations.SimpleResource,
    Response,
    Resource extends PrivateEndpointConnectionResource = PrivateEndpointResource,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  >(
    ...ResourceInstanceParameters<ParentResource, BaseParameters>,
    ...KeysOf<ResourceParameter>,
    ...Parameters,
  ): Response | Error;
}

/** PATCH model for private endpoint connections */
model PrivateEndpointConnectionUpdate
  is OptionalProperties<UpdateableProperties<OmitProperties<
    CommonTypes.PrivateEndpointConnection,
    "properties"
  >>> {
  /** The private endpoint connection properties */
  properties?: OptionalProperties<UpdateableProperties<CommonTypes.PrivateEndpointConnectionProperties>>;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/private-links.tsp":`using Http;
using Rest;
using Azure.ResourceManager.Foundations;
using Azure.ResourceManager.Private;

namespace Azure.ResourceManager;

/**
 * A private link resource.
 * Resource providers must declare a private link resource type in their provider namespace if
 * they support private link resources
 * @template Description Optional. The documentary description of the private link resource name parameter.
 * @template KeyName Optional. The name of the private link resource name parameter.
 * @example
 * \`\`\`ts
 * namespace Microsoft.Contoso;
 * model PrivateLink is PrivateLinkResource {}
 * alias EmployeeConnectionOps is PrivateLinks<PrivateLink>;
 * @armResourceOperations
 * interface Employees {
 *  @doc("get a private endpoint connection for resource employee")
 *  getPrivateEndpointConnection is EmployeeConnectionOps.Read<Employee>;
 * }
 * \`\`\`
 */
@doc(Description)
@armResourceWithParameter(
  CommonTypes.PrivateLinkResourceProperties,
  "privateLinkResources",
  "privateLinkResourceName"
)
@Http.Private.includeInapplicableMetadataInPayload(false)
model PrivateLink<Description extends valueof string = "A private link resource.">
  is CommonTypes.PrivateLinkResource;

/**
 * Operations over private link resources.
 * @template PrivateLinkResourceModel The type of the private link resource. You must declare a private link resource type in your provider namespace.
 * @template ResourceName Optional. The name of the private link resource in this context, by default, this is \`{targetResourceName}PrivateLink\`.
 * @template ResourceParameter Optional. The name parameter model for the private link resource. By default, this is \`PrivateLinkResourceParameter\`, which has a required path parameter for the private link resource name. You can use this template parameter to specify a different parameter type if needed, but it must include at least a path parameter for the private link resource name.
 *
 * @example
 * \`\`\`ts
 * namespace Microsoft.Contoso;
 * model PrivateLink is PrivateLinkResource {}
 * alias EmployeeConnectionOps is PrivateLinks<PrivateLink>;
 * @armResourceOperations
 * interface Employees {
 *  @doc("get a private link for resource employee")
 *  getPrivateLink is EmployeeConnectionOps.Read<Employee>;
 * }
 * \`\`\`
 */
interface PrivateLinks<
  PrivateLinkResourceModel extends PrivateLink,
  ResourceName extends valueof string = string(""),
  ResourceParameter extends {} = CommonTypes.PrivateLinkResourceParameter
> {
  /**
   * @dev List the private links to a resource
   * @template ParentResource the parent resource of the PrivateLink
   * @template Resource Optional. The PrivateLink resource being listed
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template ParentName Optional. The name of the parent resource
   * @template ParentFriendlyName Optional. The friendly name of the parent resource
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the list operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private link resource being operated on.
   */
  @doc("List {name} PrivateLinks", ParentResource)
  @get
  @autoRoute
  @list
  @listsResource(Resource)
  @segmentOf(ResourceParameter)
  @builtInResourceOperation(ParentResource, Resource, "list", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  ListByParent<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateLink = PrivateLinkResourceModel,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmReadOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> & Parameters,
    Response,
    Error
  >;

  /**
   * @dev List the private links to a resource - this should only be used for legacy operations
   * @template ParentResource the parent resource of the PrivateLink
   * @template Resource Optional. The PrivateLink resource being listed
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template ParentName Optional. The name of the parent resource
   * @template ParentFriendlyName Optional. The friendly name of the parent resource
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the list operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private link resource being operated on.
   */
  @Private.legacyType
  @doc("List {name} PrivateLinks", ParentResource)
  @get
  @autoRoute
  @listsResource(Resource)
  @segmentOf(ResourceParameter)
  @builtInResourceOperation(ParentResource, Resource, "list", OverrideResourceName)
  @Private.enforceConstraint(ParentResource, Foundations.Resource)
  ListSinglePageByParent<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateLink = PrivateLinkResourceModel,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<ResourceListResult<Resource>>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmReadOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> & Parameters,
    Response,
    Error
  >;

  /**
   * @dev GET the a private link to a particular resource
   * @template ParentResource the parent resource of the PrivateLink
   * @template Resource the PrivateLink resource being read
   * @template BaseParameters Optional. Allows overriding the operation parameters
   * @template Parameters Optional. Additional parameters after the path parameters
   * @template Response Optional. The success response for the read operation
   * @template Error Optional. The error response, if non-standard.
   * @template OverrideResourceName Optional. The name of the private link resource being operated on.
   */
  @autoRoute
  @doc("Get a {name} PrivateLink", ParentResource)
  @get
  @builtInResourceOperation(ParentResource, Resource, "read", OverrideResourceName)
  Read<
    ParentResource extends Foundations.SimpleResource,
    Resource extends PrivateLink = PrivateLinkResourceModel,
    BaseParameters = DefaultBaseParameters<ParentResource>,
    Parameters extends {} = {},
    Response extends {} = ArmResponse<Resource>,
    Error extends {} = ErrorResponse,
    OverrideResourceName extends valueof string = "\${ResourceName}"
  > is ArmReadOperation<
    ResourceInstanceParameters<ParentResource, BaseParameters> &
      KeysOf<ResourceParameter> &
      Parameters,
    Response,
    Error
  >;
}
`,"../../../../../../src/typespec/packages/typespec-azure-resource-manager/lib/network-security-perimeter.tsp":`namespace Azure.ResourceManager;

using Azure.ResourceManager.Private;

/**
 * Alias for network security perimeter configuration operations.
 *
 * @template NspConfigurationResourceModel The type of the network security perimeter configuration resource. You must declare a network security perimeter configuration resource type in your provider namespace.
 * @template NspConfigurationKeyName Optional. The NSP configuration resource name parameter. By default, this is \`networkSecurityPerimeterConfigurationName\`.
 * @template ResourceName Optional. The name of the network security perimeter configuration resource in this context, by default, this is \`{targetResourceName}NetworkSecurityPerimeterConfiguration\`.
 * @template ResourceParameter Optional. The name parameter for this NSP. By default, this is \`NetworkSecurityPerimeterConfigurationNameParameter\`.
 * @example
 * \`\`\`ts
 * namespace Microsoft.Contoso;
 * model NspConfiguration is NspConfigurationResource {}
 * alias EmployeeNspConfigurationOps is NspConfigurations<NspConfiguration>;
 * @armResourceOperations
 * interface Employees {
 *  @doc("get a network security perimeter configuration for resource employee")
 *  getNspConfiguration is EmployeeNspConfigurationOps.Read<Employee>;
 * }
 * \`\`\`
 */
alias NspConfigurations<
  NspConfigurationResourceModel extends CommonTypes.NetworkSecurityPerimeterConfiguration,
  NspConfigurationKeyName extends valueof string = "networkSecurityPerimeterConfigurationName",
  ResourceName extends valueof string = string(""),
  ResourceParameter extends {} = CommonTypes.NetworkSecurityPerimeterConfigurationNameParameter
> = CommonTypes.NspConfigurationOperations<
  NspConfigurationResourceModel,
  NspConfigurationKeyName,
  ResourceName,
  ResourceParameter
>;

/** Network security perimeter (NSP) configuration resource. Providers must instantiate an instance of this resource in their
 * provider namespace to enable NSP capabilities for their resources.
 *
 * @template KeyName Optional. The name of the NSP configuration resource name parameter. By default, this is \`networkSecurityPerimeterConfigurationName\`.
 * @template Description Optional. The documentary description of the NSP configuration resource name parameter.
 *
 * @example
 * \`\`\`ts
 * namespace Microsoft.Contoso;
 * model NspConfiguration is NspConfigurationResource {}
 * alias EmployeeConfigOps is NspConfigurations<NspConfiguration>;
 * @armResourceOperations
 * interface Employees {
 *  @doc("get a network security perimeter configuration for resource employee")
 *  getNspConfiguration is EmployeeConfigOps.Read<Employee>;
 * }
 * \`\`\`
 */
alias NspConfiguration<
  KeyName extends valueof string = "networkSecurityPerimeterConfigurationName",
  Description extends valueof string = "A network security perimeter configuration resource."
> = CommonTypes.NspConfigurationResource<KeyName, Description>;
`},l={jsSourceFiles:p,typespecSourceFiles:c};export{l as _TypeSpecLibrary_,i as namespace};
