Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Server.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.DBforMySQL;
/**
* A server's Advanced Threat Protection.
*/
@parentResource(Server)
model AdvancedThreatProtection
is Azure.ResourceManager.ProxyResource<AdvancedThreatProtectionProperties> {
...ResourceNameParameter<
Resource = AdvancedThreatProtection,
KeyName = "advancedThreatProtectionName",
SegmentName = "advancedThreatProtectionSettings",
NamePattern = "",
Type = AdvancedThreatProtectionName
>;
}

#suppress "@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@armResourceOperations
interface AdvancedThreatProtectionSettings {
/**
* Get a server's Advanced Threat Protection state
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
get is ArmResourceRead<AdvancedThreatProtection>;

/**
* Updates a server's Advanced Threat Protection state.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@operationId("AdvancedThreatProtectionSettings_UpdatePut")
updatePut is ArmResourceCreateOrReplaceAsync<
AdvancedThreatProtection,
Response = ArmResourceUpdatedResponse<AdvancedThreatProtection> | ArmResourceCreatedResponse<
AdvancedThreatProtection,
ArmLroLocationHeader<FinalResult = AdvancedThreatProtection> &
Azure.Core.Foundations.RetryAfterHeader
> | ArmAcceptedLroResponse
>;

/**
* Updates a server's Advanced Threat Protection state.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
@operationId("AdvancedThreatProtectionSettings_Update")
update is ArmCustomPatchAsync<
AdvancedThreatProtection,
PatchModel = AdvancedThreatProtectionForUpdate
>;

/**
* Gets a list of server's Advanced Threat Protection states.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@operationId("AdvancedThreatProtectionSettings_List")
list is ArmResourceListByParent<
AdvancedThreatProtection,
Response = ArmResponse<AdvancedThreatProtectionListResult>
>;
}

@@doc(AdvancedThreatProtection.name,
"The name of the Advanced Threat Protection state."
);
@@doc(AdvancedThreatProtection.properties, "Resource properties.");
@@doc(AdvancedThreatProtectionSettings.updatePut::parameters.resource,
"The server's Advanced Threat Protection body to update."
);
@@doc(AdvancedThreatProtectionSettings.update::parameters.properties,
"The server's Advanced Threat Protection body to update."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Server.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.DBforMySQL;
/**
* Represents a Administrator.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@parentResource(Server)
model AzureADAdministrator
is Azure.ResourceManager.ProxyResource<AdministratorProperties> {
...ResourceNameParameter<
Resource = AzureADAdministrator,
KeyName = "administratorName",
SegmentName = "administrators",
NamePattern = "",
Type = AdministratorName
>;
}

#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@armResourceOperations
interface AzureADAdministrators {
/**
* Gets information about an azure ad administrator.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
get is ArmResourceRead<AzureADAdministrator>;

/**
* Creates or updates an existing Azure Active Directory administrator.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
createOrUpdate is ArmResourceCreateOrReplaceAsync<
AzureADAdministrator,
Response = ArmResourceUpdatedResponse<AzureADAdministrator> | ArmResourceCreatedResponse<
AzureADAdministrator,
ArmLroLocationHeader<FinalResult = AzureADAdministrator> &
Azure.Core.Foundations.RetryAfterHeader
> | ArmAcceptedLroResponse
>;

/**
* Deletes an Azure AD Administrator.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
delete is ArmResourceDeleteWithoutOkAsync<
AzureADAdministrator,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
>;

/**
* List all the AAD administrators in a given server.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
listByServer is ArmResourceListByParent<
AzureADAdministrator,
Response = ArmResponse<AdministratorListResult>
>;
}

@@doc(AzureADAdministrator.name, "The name of the Azure AD Administrator.");
@@doc(AzureADAdministrator.properties, "The properties of an administrator.");
@@doc(AzureADAdministrators.createOrUpdate::parameters.resource,
"The required parameters for creating or updating an aad administrator."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.DBforMySQL;
/**
* Represents a location capability set.
*/
@subscriptionResource
@parentResource(SubscriptionLocationResource)
model Capability
is Azure.ResourceManager.ProxyResource<CapabilityPropertiesV2> {
/**
* Name of capability set
*/
@key("capabilitySetName")
@path
@segment("capabilitySets")
@pattern("^[a-z0-9][-a-z0-9]*(?<!-)$")
name: string = "default";
}

#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
interface LocationBasedCapabilityOps
extends Azure.ResourceManager.Legacy.LegacyOperations<
{
...ApiVersionParameter,
...SubscriptionIdParameter,
...Azure.ResourceManager.Legacy.Provider,
...LocationNameParameter,
},
{}
> {}

#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
interface LocationBasedCapabilityOperationOps
extends Azure.ResourceManager.Legacy.LegacyOperations<
{
...ApiVersionParameter,
...SubscriptionIdParameter,
...Azure.ResourceManager.Legacy.Provider,
...LocationNameParameter,

/**
* Name of capability set
*/
@path
@segment("capabilitySets")
@pattern("^[a-z0-9][-a-z0-9]*(?<!-)$")
capabilitySetName: string = "default",
},
{}
> {}

@armResourceOperations
interface LocationBasedCapabilitySet {
/**
* Get capabilities at specified location in a given subscription.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
get is LocationBasedCapabilityOperationOps.Read<Capability>;

/**
* Get capabilities at specified location in a given subscription.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@action("capabilitySets")
@get
@list
list is LocationBasedCapabilityOps.Read<
Capability,
Response = ArmResponse<CapabilitySetsList>
>;
}

@@doc(Capability.name, "Name of capability set");
@@doc(Capability.properties, "The properties of a location capability set.");
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Server.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.DBforMySQL;
/**
* Represents a Configuration.
*/
@parentResource(Server)
model Configuration
is Azure.ResourceManager.ProxyResource<ConfigurationProperties> {
...ResourceNameParameter<
Resource = Configuration,
KeyName = "configurationName",
SegmentName = "configurations",
NamePattern = ""
>;
}

#suppress "@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@armResourceOperations
interface Configurations {
/**
* Gets information about a configuration of server.
*/
get is ArmResourceRead<Configuration>;

/**
* Updates a configuration of a server.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
createOrUpdate is ArmResourceCreateOrReplaceAsync<
Configuration,
Response = ArmResourceUpdatedResponse<Configuration> | ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Configuration> &
Azure.Core.Foundations.RetryAfterHeader>
>;

/**
* Updates a configuration of a server.
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchAsync<Configuration, PatchModel = Configuration>;

/**
* List all the configurations in a given server.
*/
@TypeSpec.list
listByServer is ArmResourceListByParent<
Configuration,
Parameters = {
/**
* The tags of the server configuration.
*/
@query("tags")
tags?: string;

/**
* The keyword of the server configuration.
*/
@query("keyword")
keyword?: string;

/**
* The page of the server configuration.
*/
@query("page")
page?: int32;

/**
* The pageSize of the server configuration.
*/
@query("pageSize")
pageSize?: int32;
},
Response = ArmResponse<ConfigurationListResult>
>;

/**
* Update a list of configurations in a given server.
*/
#suppress "@azure-tools/typespec-azure-core/invalid-final-state" ""
#suppress "@azure-tools/typespec-azure-core/no-openapi" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@action("updateConfigurations")
@Azure.Core.useFinalStateVia("azure-async-operation")
batchUpdate is ArmResourceActionAsyncBase<
Server,
ConfigurationListForBatchUpdate,
BaseParameters = Azure.ResourceManager.Foundations.ResourceGroupBaseParameters,
Response = ArmResponse<ConfigurationListResult> | ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader<FinalResult = ConfigurationListResult> &
ArmLroLocationHeader>
>;
}

@@doc(Configuration.name, "The name of the server configuration.");
@@doc(Configuration.properties, "The properties of a configuration.");
@@doc(Configurations.createOrUpdate::parameters.resource,
"The required parameters for updating a server configuration."
);
@@doc(Configurations.update::parameters.properties,
"The required parameters for updating a server configuration."
);
@@doc(Configurations.batchUpdate::parameters.body,
"The parameters for updating a list of server configuration."
);
Loading
Loading