1
+ // ----------------------------------------------------------------------------------
2
+ //
3
+ // Copyright Microsoft Corporation
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ // ----------------------------------------------------------------------------------
14
+
15
+ using System . Collections ;
16
+ using System . Management . Automation ;
17
+
18
+ namespace Microsoft . Azure . Commands . ResourceManager . Cmdlets . Implementation . CmdletBase
19
+ {
20
+ public class DeploymentStacksCreateCmdletBase : DeploymentStacksCmdletBase
21
+ {
22
+ #region Cmdlet Parameters and Parameter Set Definitions
23
+
24
+ protected string protectedTemplateUri ;
25
+
26
+ protected DeploymentStacksCreateCmdletBase ( )
27
+ {
28
+ }
29
+
30
+ internal const string ParameterlessTemplateFileParameterSetName = "ByTemplateFileWithNoParameters" ;
31
+ internal const string ParameterlessTemplateUriParameterSetName = "ByTemplateUriWithNoParameters" ;
32
+ internal const string ParameterlessTemplateSpecParameterSetName = "ByTemplateSpecWithNoParameters" ;
33
+
34
+ internal const string ParameterFileTemplateFileParameterSetName = "ByTemplateFileWithParameterFile" ;
35
+ internal const string ParameterFileTemplateUriParameterSetName = "ByTemplateUriWithParameterFile" ;
36
+ internal const string ParameterFileTemplateSpecParameterSetName = "ByTemplateSpecWithParameterFile" ;
37
+
38
+ internal const string ParameterUriTemplateFileParameterSetName = "ByTemplateFileWithParameterUri" ;
39
+ internal const string ParameterUriTemplateUriParameterSetName = "ByTemplateUriWithParameterUri" ;
40
+ internal const string ParameterUriTemplateSpecParameterSetName = "ByTemplateSpecWithParameterUri" ;
41
+
42
+ internal const string ParameterObjectTemplateFileParameterSetName = "ByTemplateFileWithParameterObject" ;
43
+ internal const string ParameterObjectTemplateUriParameterSetName = "ByTemplateUriWithParameterObject" ;
44
+ internal const string ParameterObjectTemplateSpecParameterSetName = "ByTemplateSpecWithParameterObject" ;
45
+
46
+ [ Parameter ( ParameterSetName = ParameterFileTemplateFileParameterSetName ,
47
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "TemplateFile to be used to create the stack." ) ]
48
+ [ Parameter ( ParameterSetName = ParameterUriTemplateFileParameterSetName ,
49
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "TemplateFile to be used to create the stack." ) ]
50
+ [ Parameter ( ParameterSetName = ParameterObjectTemplateFileParameterSetName ,
51
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "TemplateFile to be used to create the stack." ) ]
52
+ [ Parameter ( ParameterSetName = ParameterlessTemplateFileParameterSetName ,
53
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "TemplateFile to be used to create the stack." ) ]
54
+ public string TemplateFile { get ; set ; }
55
+
56
+ [ Parameter ( ParameterSetName = ParameterFileTemplateUriParameterSetName ,
57
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Location of the Template to be used to create the stack." ) ]
58
+ [ Parameter ( ParameterSetName = ParameterUriTemplateUriParameterSetName ,
59
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Location of the Template to be used to create the stack." ) ]
60
+ [ Parameter ( ParameterSetName = ParameterObjectTemplateUriParameterSetName ,
61
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Location of the Template to be used to create the stack." ) ]
62
+ [ Parameter ( ParameterSetName = ParameterlessTemplateUriParameterSetName ,
63
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Location of the Template to be used to create the stack." ) ]
64
+ public string TemplateUri { get ; set ; }
65
+
66
+ [ Parameter ( ParameterSetName = ParameterFileTemplateSpecParameterSetName ,
67
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "ResourceId of the TemplateSpec to be used to create the stack." ) ]
68
+ [ Parameter ( ParameterSetName = ParameterUriTemplateSpecParameterSetName ,
69
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "ResourceId of the TemplateSpec to be used to create the stack." ) ]
70
+ [ Parameter ( ParameterSetName = ParameterObjectTemplateSpecParameterSetName ,
71
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "ResourceId of the TemplateSpec to be used to create the stack." ) ]
72
+ [ Parameter ( ParameterSetName = ParameterlessTemplateSpecParameterSetName ,
73
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "ResourceId of the TemplateSpec to be used to create the stack." ) ]
74
+ public string TemplateSpecId { get ; set ; }
75
+
76
+ [ Parameter ( ParameterSetName = ParameterFileTemplateFileParameterSetName ,
77
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Parameter file to use for the template." ) ]
78
+ [ Parameter ( ParameterSetName = ParameterFileTemplateUriParameterSetName ,
79
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Parameter file to use for the template." ) ]
80
+ [ Parameter ( ParameterSetName = ParameterFileTemplateSpecParameterSetName ,
81
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Parameter file to use for the template." ) ]
82
+ public string TemplateParameterFile { get ; set ; }
83
+
84
+ [ Parameter ( ParameterSetName = ParameterUriTemplateFileParameterSetName ,
85
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Location of the Parameter file to use for the template." ) ]
86
+ [ Parameter ( ParameterSetName = ParameterUriTemplateUriParameterSetName ,
87
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Location of the Parameter file to use for the template." ) ]
88
+ [ Parameter ( ParameterSetName = ParameterUriTemplateSpecParameterSetName ,
89
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "Location of the Parameter file to use for the template." ) ]
90
+ public string TemplateParameterUri { get ; set ; }
91
+
92
+ [ Parameter ( ParameterSetName = ParameterObjectTemplateFileParameterSetName ,
93
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "A hash table which represents the parameters." ) ]
94
+ [ Parameter ( ParameterSetName = ParameterObjectTemplateUriParameterSetName ,
95
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "A hash table which represents the parameters." ) ]
96
+ [ Parameter ( ParameterSetName = ParameterObjectTemplateSpecParameterSetName ,
97
+ Mandatory = true , ValueFromPipelineByPropertyName = true , HelpMessage = "A hash table which represents the parameters." ) ]
98
+ public Hashtable TemplateParameterObject { get ; set ; }
99
+
100
+ [ Parameter ( Mandatory = false , HelpMessage = "Skips the PowerShell dynamic parameter processing that checks if the provided template parameter contains all necessary parameters used by the template. " +
101
+ "This check would prompt the user to provide a value for the missing parameters, but providing the -SkipTemplateParameterPrompt will ignore this prompt and " +
102
+ "error out immediately if a parameter was found not to be bound in the template. For non-interactive scripts, -SkipTemplateParameterPrompt can be provided " +
103
+ "to provide a better error message in the case where not all required parameters are satisfied." ) ]
104
+ public SwitchParameter SkipTemplateParameterPrompt { get ; set ; }
105
+
106
+ [ Parameter ( Mandatory = false , HelpMessage = "The query string (for example, a SAS token) to be used with the TemplateUri parameter. Would be used in case of linked templates" ) ]
107
+ public string QueryString { get ; set ; }
108
+
109
+ #endregion
110
+ }
111
+ }
0 commit comments