Skip to content

Commit e37b2a4

Browse files
Policy => Strategy
1 parent 29af582 commit e37b2a4

File tree

7 files changed

+40
-40
lines changed

7 files changed

+40
-40
lines changed

src/ResourceManager/Common/Commands.Common.Strategies/Commands.Common.Strategies.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@
7373
<Compile Include="IClient.cs" />
7474
<Compile Include="IResourceConfig.cs" />
7575
<Compile Include="IResourceConfigVisitor.cs" />
76-
<Compile Include="IResourcePolicy.cs" />
76+
<Compile Include="IResourceStrategy.cs" />
7777
<Compile Include="IState.cs" />
7878
<Compile Include="NestedResourceConfig.cs" />
79-
<Compile Include="NestedResourcePolicy.cs" />
79+
<Compile Include="NestedResourceStrategy.cs" />
8080
<Compile Include="TargetState.cs" />
8181
<Compile Include="Properties\AssemblyInfo.cs" />
8282
<Compile Include="ResourceConfig.cs" />
83-
<Compile Include="ResourcePolicy.cs" />
83+
<Compile Include="ResourceStrategy.cs" />
8484
<Compile Include="State.cs" />
8585
<Compile Include="StateLocation.cs" />
8686
</ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Microsoft.Azure.Commands.Common.Strategies
22
{
3-
public interface IResourcePolicy
3+
public interface IResourceStrategy
44
{
55
}
66
}

src/ResourceManager/Common/Commands.Common.Strategies/NestedResourceConfig.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ namespace Microsoft.Azure.Commands.Common.Strategies
77
public static class NestedResourceConfig
88
{
99
public static NestedResourceConfig<Model, ParentModel> CreateConfig<Model, ParentModel>(
10-
this NestedResourcePolicy<Model, ParentModel> policy,
10+
this NestedResourceStrategy<Model, ParentModel> strategy,
1111
IResourceConfig<ParentModel> parent,
1212
string name,
1313
Func<Model> create)
1414
where Model : class
1515
where ParentModel : class
16-
=> new NestedResourceConfig<Model, ParentModel>(policy, parent, name, create);
16+
=> new NestedResourceConfig<Model, ParentModel>(strategy, parent, name, create);
1717
}
1818

1919
public sealed class NestedResourceConfig<Model, ParentModel> : IResourceConfig<Model>
2020
where Model : class
2121
where ParentModel : class
2222
{
23-
public NestedResourcePolicy<Model, ParentModel> Policy { get; }
23+
public NestedResourceStrategy<Model, ParentModel> Policy { get; }
2424

2525
public string Name { get; }
2626

@@ -29,7 +29,7 @@ public sealed class NestedResourceConfig<Model, ParentModel> : IResourceConfig<M
2929
public Func<Model> CreateModel { get; }
3030

3131
public NestedResourceConfig(
32-
NestedResourcePolicy<Model, ParentModel> policy,
32+
NestedResourceStrategy<Model, ParentModel> policy,
3333
IResourceConfig<ParentModel> parent,
3434
string name,
3535
Func<Model> createModel)

src/ResourceManager/Common/Commands.Common.Strategies/NestedResourcePolicy.cs renamed to src/ResourceManager/Common/Commands.Common.Strategies/NestedResourceStrategy.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
namespace Microsoft.Azure.Commands.Common.Strategies
55
{
6-
public sealed class NestedResourcePolicy<Model, ParentModel> : IResourcePolicy
6+
public sealed class NestedResourceStrategy<Model, ParentModel> : IResourceStrategy
77
{
88
public Func<string, IEnumerable<string>> GetId { get; }
99

1010
public Func<ParentModel, string, Model> Get { get; }
1111

1212
public Action<ParentModel, string, Model> Set { get; }
1313

14-
public NestedResourcePolicy(
14+
public NestedResourceStrategy(
1515
Func<string, IEnumerable<string>> getId,
1616
Func<ParentModel, string, Model> get,
1717
Action<ParentModel, string, Model> set)
@@ -22,15 +22,15 @@ public NestedResourcePolicy(
2222
}
2323
}
2424

25-
public static class NestedResourcePolicy
25+
public static class NestedResourceStraegy
2626
{
27-
public static NestedResourcePolicy<Model, ParentModel> Create<Model, ParentModel>(
27+
public static NestedResourceStrategy<Model, ParentModel> Create<Model, ParentModel>(
2828
string header,
2929
Func<ParentModel, string, Model> get,
3030
Action<ParentModel, string, Model> set)
3131
where Model : class
3232
where ParentModel : class
33-
=> new NestedResourcePolicy<Model, ParentModel>(
33+
=> new NestedResourceStrategy<Model, ParentModel>(
3434
name => new[] { header, name},
3535
get,
3636
set);

src/ResourceManager/Common/Commands.Common.Strategies/ResourceConfig.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.Azure.Commands.Common.Strategies
88
public sealed class ResourceConfig<Model> : IResourceConfig<Model>
99
where Model : class
1010
{
11-
public ResourcePolicy<Model> Policy { get; }
11+
public ResourceStrategy<Model> Policy { get; }
1212

1313
public string ResourceGroupName { get; }
1414

@@ -19,7 +19,7 @@ public sealed class ResourceConfig<Model> : IResourceConfig<Model>
1919
public IEnumerable<IResourceConfig> Dependencies { get; }
2020

2121
public ResourceConfig(
22-
ResourcePolicy<Model> policy,
22+
ResourceStrategy<Model> policy,
2323
string resourceGroupName,
2424
string name,
2525
Func<string, Model> createModel,
@@ -49,7 +49,7 @@ public IEnumerable<string> GetId(string subscription)
4949
public static class ResourceConfig
5050
{
5151
public static ResourceConfig<Model> CreateConfig<Model>(
52-
this ResourcePolicy<Model> policy,
52+
this ResourceStrategy<Model> policy,
5353
string resourceGroupName,
5454
string name,
5555
Func<string, Model> createModel = null,
@@ -63,7 +63,7 @@ public static ResourceConfig<Model> CreateConfig<Model>(
6363
dependencies.EmptyIfNull());
6464

6565
public static ResourceConfig<Model> CreateConfig<Model>(
66-
this ResourcePolicy<Model> policy,
66+
this ResourceStrategy<Model> policy,
6767
ResourceConfig<ResourceGroup> resourceGroup,
6868
string name,
6969
Func<string, Model> createModel = null,

src/ResourceManager/Common/Commands.Common.Strategies/ResourcePolicy.cs renamed to src/ResourceManager/Common/Commands.Common.Strategies/ResourceStrategy.cs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55

66
namespace Microsoft.Azure.Commands.Common.Strategies
77
{
8-
public sealed class ResourcePolicy<Config> : IResourcePolicy
8+
public sealed class ResourceStrategy<Model> : IResourceStrategy
99
{
1010
public Func<string, IEnumerable<string>> GetId { get; }
1111

12-
public Func<GetAsyncParams<IClient>, Task<Config>> GetAsync { get; }
12+
public Func<GetAsyncParams<IClient>, Task<Model>> GetAsync { get; }
1313

14-
public Func<CreateOrUpdateAsyncParams<IClient, Config>, Task<Config>> CreateOrUpdateAsync { get; }
14+
public Func<CreateOrUpdateAsyncParams<IClient, Model>, Task<Model>> CreateOrUpdateAsync { get; }
1515

16-
public Func<Config, string> GetLocation { get; }
16+
public Func<Model, string> GetLocation { get; }
1717

18-
public Action<Config, string> SetLocation { get; }
18+
public Action<Model, string> SetLocation { get; }
1919

20-
public ResourcePolicy(
20+
public ResourceStrategy(
2121
Func<string, IEnumerable<string>> getId,
22-
Func<GetAsyncParams<IClient>, Task<Config>> getAsync,
23-
Func<CreateOrUpdateAsyncParams<IClient, Config>, Task<Config>> createOrUpdateAsync,
24-
Func<Config, string> getLocation,
25-
Action<Config, string> setLocation)
22+
Func<GetAsyncParams<IClient>, Task<Model>> getAsync,
23+
Func<CreateOrUpdateAsyncParams<IClient, Model>, Task<Model>> createOrUpdateAsync,
24+
Func<Model, string> getLocation,
25+
Action<Model, string> setLocation)
2626
{
2727
GetId = getId;
2828
GetAsync = getAsync;
@@ -32,19 +32,19 @@ public ResourcePolicy(
3232
}
3333
}
3434

35-
public static class ResourcePolicy
35+
public static class ResourceStrategy
3636
{
37-
public static ResourcePolicy<Config> Create<Config, Client, Operations>(
37+
public static ResourceStrategy<Model> Create<Model, Client, Operations>(
3838
Func<string, IEnumerable<string>> getId,
3939
Func<Client, Operations> getOperations,
40-
Func<GetAsyncParams<Operations>, Task<Config>> getAsync,
41-
Func<CreateOrUpdateAsyncParams<Operations, Config>, Task<Config>> createOrUpdateAsync,
42-
Func<Config, string> getLocation,
43-
Action<Config, string> setLocation)
40+
Func<GetAsyncParams<Operations>, Task<Model>> getAsync,
41+
Func<CreateOrUpdateAsyncParams<Operations, Model>, Task<Model>> createOrUpdateAsync,
42+
Func<Model, string> getLocation,
43+
Action<Model, string> setLocation)
4444
where Client : class, IDisposable
4545
{
4646
Func<IClient, Operations> toOperations = client => getOperations(client.GetClient<Client>());
47-
return new ResourcePolicy<Config>(
47+
return new ResourceStrategy<Model>(
4848
getId,
4949
p => getAsync(GetAsyncParams.Create(
5050
toOperations(p.Operations), p.ResourceGroupName, p.Name, p.CancellationToken)),
@@ -54,13 +54,13 @@ public static ResourcePolicy<Config> Create<Config, Client, Operations>(
5454
setLocation);
5555
}
5656

57-
public static ResourcePolicy<Config> Create<Config, Client, Operations>(
57+
public static ResourceStrategy<Model> Create<Model, Client, Operations>(
5858
IEnumerable<string> headers,
5959
Func<Client, Operations> getOperations,
60-
Func<GetAsyncParams<Operations>, Task<Config>> getAsync,
61-
Func<CreateOrUpdateAsyncParams<Operations, Config>, Task<Config>> createOrUpdateAsync,
62-
Func<Config, string> getLocation,
63-
Action<Config, string> setLocation)
60+
Func<GetAsyncParams<Operations>, Task<Model>> getAsync,
61+
Func<CreateOrUpdateAsyncParams<Operations, Model>, Task<Model>> createOrUpdateAsync,
62+
Func<Model, string> getLocation,
63+
Action<Model, string> setLocation)
6464
where Client : class, IDisposable
6565
=> Create(
6666
name => new[] { "providers" }.Concat(headers).Concat(new[] { name }),

src/ResourceManager/Compute/AzureRM.Compute.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ CLRVersion = '4.0'
5454
RequiredModules = @(@{ModuleName = 'AzureRM.Profile'; ModuleVersion = '3.3.1'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
57-
# RequiredAssemblies = @()
57+
RequiredAssemblies = @('Microsoft.Azure.Commands.Common.Strategies')
5858

5959
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
6060
# ScriptsToProcess = @()

0 commit comments

Comments
 (0)