Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR security/resource-manager] Settings API - changed the kind to work with .net nuget #882

Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@azure/arm-security/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
Copyright (c) 2019 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export {
AutoProvisioningSetting,
Compliance,
ComplianceSegment,
SettingResource,
InformationProtectionPolicy,
SensitivityLabel,
InformationType,
Expand All @@ -29,6 +30,8 @@ export {
AscLocation,
Alert,
AlertEntity,
AlertConfidenceReason
AlertConfidenceReason,
Setting,
DataExportSetting
} from "../models/mappers";

5 changes: 4 additions & 1 deletion packages/@azure/arm-security/lib/models/alertsMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ export {
Compliance,
ComplianceSegment,
AdvancedThreatProtectionSetting,
SettingResource,
InformationProtectionPolicy,
SensitivityLabel,
InformationType,
InformationProtectionKeyword,
SecurityTask,
SecurityTaskParameters,
AscLocation
AscLocation,
Setting,
DataExportSetting
} from "../models/mappers";

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export {
Compliance,
ComplianceSegment,
AdvancedThreatProtectionSetting,
SettingResource,
InformationProtectionPolicy,
SensitivityLabel,
InformationType,
Expand All @@ -30,6 +31,8 @@ export {
AscLocation,
Alert,
AlertEntity,
AlertConfidenceReason
AlertConfidenceReason,
Setting,
DataExportSetting
} from "../models/mappers";

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export {
WorkspaceSetting,
AutoProvisioningSetting,
AdvancedThreatProtectionSetting,
SettingResource,
InformationProtectionPolicy,
SensitivityLabel,
InformationType,
Expand All @@ -30,6 +31,8 @@ export {
AscLocation,
Alert,
AlertEntity,
AlertConfidenceReason
AlertConfidenceReason,
Setting,
DataExportSetting
} from "../models/mappers";

95 changes: 25 additions & 70 deletions packages/@azure/arm-security/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,90 +205,45 @@ export interface AdvancedThreatProtectionSetting extends Resource {
}

/**
* Contains the possible cases for Setting.
* @interface
* An interface representing SettingResource.
* The kind of the security setting
*
* @extends Resource
*/
export type SettingUnion = Setting | DataExportSetting;
export interface SettingResource extends Resource {
/**
* @member {SettingKind} kind the kind of the settings string
* (DataExportSetting). Possible values include: 'DataExportSetting',
* 'AlertSuppressionSetting'
*/
kind: SettingKind;
}

/**
* @interface
* An interface representing Setting.
* Represents a security setting in Azure Security Center.
*
* @extends SettingResource
*/
export interface Setting {
/**
* @member {string} kind Polymorphic Discriminator
*/
kind: "Setting";
/**
* @member {string} [id] Resource Id
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly id?: string;
/**
* @member {string} [name] Resource name
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly name?: string;
/**
* @member {string} [type] Resource type
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly type?: string;
export interface Setting extends SettingResource {
}

/**
* @interface
* An interface representing DataExportSetting.
* Represents a data export setting
*
* @extends Setting
*/
export interface DataExportSetting {
/**
* @member {string} kind Polymorphic Discriminator
*/
kind: "DataExportSetting";
/**
* @member {string} [id] Resource Id
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly id?: string;
/**
* @member {string} [name] Resource name
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly name?: string;
/**
* @member {string} [type] Resource type
* **NOTE: This property will not be serialized. It can only be populated by
* the server.**
*/
readonly type?: string;
export interface DataExportSetting extends Setting {
/**
* @member {boolean} enabled Is the data export setting is enabled
*/
enabled: boolean;
}

/**
* @interface
* An interface representing SettingKind1.
* The kind of the security setting
*
*/
export interface SettingKind1 {
/**
* @member {SettingKind} [kind] the kind of the settings string. Possible
* values include: 'DataExportSetting'
*/
kind?: SettingKind;
}

/**
* @interface
* An interface representing SensitivityLabel.
Expand Down Expand Up @@ -1771,9 +1726,9 @@ export interface ComplianceList extends Array<Compliance> {
* An interface representing the SettingsList.
* Subscription settings list.
*
* @extends Array<SettingUnion>
* @extends Array<Setting>
*/
export interface SettingsList extends Array<SettingUnion> {
export interface SettingsList extends Array<Setting> {
/**
* @member {string} [nextLink] The URI to fetch the next page.
* **NOTE: This property will not be serialized. It can only be populated by
Expand Down Expand Up @@ -1968,11 +1923,11 @@ export type AutoProvision = 'On' | 'Off';

/**
* Defines values for SettingKind.
* Possible values include: 'DataExportSetting'
* Possible values include: 'DataExportSetting', 'AlertSuppressionSetting'
* @readonly
* @enum {string}
*/
export type SettingKind = 'DataExportSetting';
export type SettingKind = 'DataExportSetting' | 'AlertSuppressionSetting';

/**
* Defines values for SecurityFamily.
Expand Down Expand Up @@ -2629,7 +2584,7 @@ export type SettingsListResponse = SettingsList & {
/**
* Contains response data for the get operation.
*/
export type SettingsGetResponse = SettingUnion & {
export type SettingsGetResponse = Setting & {
/**
* The underlying HTTP response.
*/
Expand All @@ -2641,14 +2596,14 @@ export type SettingsGetResponse = SettingUnion & {
/**
* The response body as parsed JSON or XML
*/
parsedBody: SettingUnion;
parsedBody: Setting;
};
};

/**
* Contains response data for the update operation.
*/
export type SettingsUpdateResponse = SettingUnion & {
export type SettingsUpdateResponse = Setting & {
/**
* The underlying HTTP response.
*/
Expand All @@ -2660,7 +2615,7 @@ export type SettingsUpdateResponse = SettingUnion & {
/**
* The response body as parsed JSON or XML
*/
parsedBody: SettingUnion;
parsedBody: Setting;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ export {
Compliance,
ComplianceSegment,
AdvancedThreatProtectionSetting,
SettingResource,
SecurityTask,
SecurityTaskParameters,
AscLocation,
Alert,
AlertEntity,
AlertConfidenceReason
AlertConfidenceReason,
Setting,
DataExportSetting
} from "../models/mappers";

5 changes: 4 additions & 1 deletion packages/@azure/arm-security/lib/models/locationsMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export {
Compliance,
ComplianceSegment,
AdvancedThreatProtectionSetting,
SettingResource,
InformationProtectionPolicy,
SensitivityLabel,
InformationType,
Expand All @@ -30,6 +31,8 @@ export {
SecurityTaskParameters,
Alert,
AlertEntity,
AlertConfidenceReason
AlertConfidenceReason,
Setting,
DataExportSetting
} from "../models/mappers";

69 changes: 15 additions & 54 deletions packages/@azure/arm-security/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,38 +239,13 @@ export const AdvancedThreatProtectionSetting: msRest.CompositeMapper = {
}
};

export const Setting: msRest.CompositeMapper = {
serializedName: "Setting",
export const SettingResource: msRest.CompositeMapper = {
serializedName: "SettingResource",
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "kind",
clientName: "kind"
},
uberParent: "Setting",
className: "Setting",
className: "SettingResource",
modelProperties: {
id: {
readOnly: true,
serializedName: "id",
type: {
name: "String"
}
},
name: {
readOnly: true,
serializedName: "name",
type: {
name: "String"
}
},
type: {
readOnly: true,
serializedName: "type",
type: {
name: "String"
}
},
...Resource.type.modelProperties,
kind: {
required: true,
serializedName: "kind",
Expand All @@ -282,12 +257,21 @@ export const Setting: msRest.CompositeMapper = {
}
};

export const Setting: msRest.CompositeMapper = {
serializedName: "Setting",
type: {
name: "Composite",
className: "Setting",
modelProperties: {
...SettingResource.type.modelProperties
}
}
};

export const DataExportSetting: msRest.CompositeMapper = {
serializedName: "DataExportSetting",
type: {
name: "Composite",
polymorphicDiscriminator: Setting.type.polymorphicDiscriminator,
uberParent: "Setting",
className: "DataExportSetting",
modelProperties: {
...Setting.type.modelProperties,
Expand All @@ -302,22 +286,6 @@ export const DataExportSetting: msRest.CompositeMapper = {
}
};

export const SettingKind1: msRest.CompositeMapper = {
serializedName: "SettingKind",
type: {
name: "Composite",
className: "SettingKind1",
modelProperties: {
kind: {
serializedName: "kind",
type: {
name: "String"
}
}
}
}
};

export const SensitivityLabel: msRest.CompositeMapper = {
serializedName: "SensitivityLabel",
type: {
Expand Down Expand Up @@ -2042,11 +2010,6 @@ export const SettingsList: msRest.CompositeMapper = {
element: {
type: {
name: "Composite",
polymorphicDiscriminator: {
serializedName: "kind",
clientName: "kind"
},
uberParent: "Setting",
className: "Setting"
}
}
Expand Down Expand Up @@ -2363,8 +2326,6 @@ export const AllowedConnectionsList: msRest.CompositeMapper = {
};

export const discriminators = {
'Setting' : Setting,
'Setting.DataExportSetting' : DataExportSetting,
'ExternalSecuritySolution' : ExternalSecuritySolution,
'ExternalSecuritySolution.CEF' : CefExternalSecuritySolution,
'ExternalSecuritySolution.ATA' : AtaExternalSecuritySolution,
Expand Down
Loading