Skip to content
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>0.0.2-beta</version>
<version>0.0.3-beta</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>azure-mgmt-workloadmonitor</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@
package com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation.NotificationSettingInner;
import com.microsoft.azure.arm.model.Indexable;
import com.microsoft.azure.arm.model.Updatable;
import com.microsoft.azure.arm.model.Appliable;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation.WorkloadMonitorManager;
import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation.NotificationSettingInner;
import java.util.List;

/**
* Type representing NotificationSetting.
*/
public interface NotificationSetting extends HasInner<NotificationSettingInner>, HasManager<WorkloadMonitorManager> {
public interface NotificationSetting extends HasInner<NotificationSettingInner>, Indexable, Updatable<NotificationSetting.Update>, HasManager<WorkloadMonitorManager> {
/**
* @return the actionGroups value.
* @return the actionGroupResourceIds value.
*/
List<String> actionGroups();
List<String> actionGroupResourceIds();

/**
* @return the etag value.
Expand All @@ -43,4 +46,15 @@ public interface NotificationSetting extends HasInner<NotificationSettingInner>,
*/
String type();

/**
* The template for a NotificationSetting update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<NotificationSetting> {
}

/**
* Grouping of NotificationSetting update stages.
*/
interface UpdateStages {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Model for properties of a NotificationSetting.
*/
public class NotificationSettingProperties {
/**
* List of action group resource ids to be notified.
*/
@JsonProperty(value = "actionGroupResourceIds", access = JsonProperty.Access.WRITE_ONLY)
private List<String> actionGroupResourceIds;

/**
* Get list of action group resource ids to be notified.
*
* @return the actionGroupResourceIds value
*/
public List<String> actionGroupResourceIds() {
return this.actionGroupResourceIds;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
package com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview;

import rx.Observable;
import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation.NotificationSettingsInner;
import com.microsoft.azure.arm.model.HasInner;

/**
* Type representing NotificationSettings.
*/
public interface NotificationSettings {
public interface NotificationSettings extends HasInner<NotificationSettingsInner> {
/**
* Get list of notification settings for a resource.
*
Expand All @@ -26,4 +28,16 @@ public interface NotificationSettings {
*/
Observable<NotificationSetting> listByResourceAsync(final String resourceGroupName, final String resourceNamespace, final String resourceType, final String resourceName);

/**
* Get a of notification setting for a resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceNamespace The Namespace of the resource.
* @param resourceType The type of the resource.
* @param resourceName Name of the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<NotificationSetting> getAsync(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation.WorkloadMonitorManager;
import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation.NotificationSettingsCollectionInner;
import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation.NotificationSettingInner;
import java.util.List;

/**
* Type representing NotificationSettingsCollection.
*/
public interface NotificationSettingsCollection extends HasInner<NotificationSettingsCollectionInner>, HasManager<WorkloadMonitorManager> {
/**
* @return the value value.
*/
List<NotificationSettingInner> value();

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,36 @@
package com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation;

import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.NotificationSetting;
import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl;
import rx.Observable;
import java.util.List;

class NotificationSettingImpl extends WrapperImpl<NotificationSettingInner> implements NotificationSetting {
class NotificationSettingImpl extends CreatableUpdatableImpl<NotificationSetting, NotificationSettingInner, NotificationSettingImpl> implements NotificationSetting, NotificationSetting.Update {
private final WorkloadMonitorManager manager;
private String resourceGroupName;
private String resourceNamespace;
private String resourceType;
private String resourceName;

NotificationSettingImpl(String name, WorkloadMonitorManager manager) {
super(name, new NotificationSettingInner());
this.manager = manager;
// Set resource name
this.resourceNamespace = name;
//
}

NotificationSettingImpl(NotificationSettingInner inner, WorkloadMonitorManager manager) {
super(inner);
super(inner.name(), inner);
this.manager = manager;
// Set resource name
this.resourceNamespace = inner.name();
// set resource ancestor and positional variables
this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups");
this.resourceNamespace = IdParsingUtils.getValueFromIdByName(inner.id(), "providers");
this.resourceType = IdParsingUtils.getValueFromIdByPosition(inner.id(), 6);
this.resourceName = IdParsingUtils.getValueFromIdByPosition(inner.id(), 7);
//
}

@Override
Expand All @@ -25,8 +47,33 @@ public WorkloadMonitorManager manager() {
}

@Override
public List<String> actionGroups() {
return this.inner().actionGroups();
public Observable<NotificationSetting> createResourceAsync() {
NotificationSettingsInner client = this.manager().inner().notificationSettings();
return null; // NOP createResourceAsync implementation as create is not supported
}

@Override
public Observable<NotificationSetting> updateResourceAsync() {
NotificationSettingsInner client = this.manager().inner().notificationSettings();
return client.updateAsync(this.resourceGroupName, this.resourceNamespace, this.resourceType, this.resourceName)
.map(innerToFluentMap(this));
}

@Override
protected Observable<NotificationSettingInner> getInnerAsync() {
NotificationSettingsInner client = this.manager().inner().notificationSettings();
return null; // NOP getInnerAsync implementation as get is not supported
}

@Override
public boolean isInCreateMode() {
return this.inner().id() == null;
}


@Override
public List<String> actionGroupResourceIds() {
return this.inner().actionGroupResourceIds();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.microsoft.azure.ProxyResource;

/**
* Model for component.
* Model for NotificationSetting.
*/
@JsonFlatten
public class NotificationSettingInner extends ProxyResource {
Expand All @@ -27,8 +27,8 @@ public class NotificationSettingInner extends ProxyResource {
/**
* List of action group resource ids to be notified.
*/
@JsonProperty(value = "properties.actionGroups", access = JsonProperty.Access.WRITE_ONLY)
private List<String> actionGroups;
@JsonProperty(value = "properties.actionGroupResourceIds", access = JsonProperty.Access.WRITE_ONLY)
private List<String> actionGroupResourceIds;

/**
* Get for optimistic concurrency control.
Expand All @@ -42,10 +42,10 @@ public String etag() {
/**
* Get list of action group resource ids to be notified.
*
* @return the actionGroups value
* @return the actionGroupResourceIds value
*/
public List<String> actionGroups() {
return this.actionGroups;
public List<String> actionGroupResourceIds() {
return this.actionGroupResourceIds;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation;

import com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.NotificationSettingsCollection;
import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import java.util.List;

class NotificationSettingsCollectionImpl extends WrapperImpl<NotificationSettingsCollectionInner> implements NotificationSettingsCollection {
private final WorkloadMonitorManager manager;
NotificationSettingsCollectionImpl(NotificationSettingsCollectionInner inner, WorkloadMonitorManager manager) {
super(inner);
this.manager = manager;
}

@Override
public WorkloadMonitorManager manager() {
return this.manager;
}

@Override
public List<NotificationSettingInner> value() {
return this.inner().value();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Model for collection of notificationSettings.
*/
public class NotificationSettingsCollectionInner {
/**
* The value property.
*/
@JsonProperty(value = "value")
private List<NotificationSettingInner> value;

/**
* Get the value value.
*
* @return the value value
*/
public List<NotificationSettingInner> value() {
return this.value;
}

/**
* Set the value value.
*
* @param value the value value to set
* @return the NotificationSettingsCollectionInner object itself.
*/
public NotificationSettingsCollectionInner withValue(List<NotificationSettingInner> value) {
this.value = value;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* abc
*
*/

package com.microsoft.azure.management.workloadmonitor.v2018_08_31_preview.implementation;
Expand All @@ -28,6 +28,10 @@ public WorkloadMonitorManager manager() {
return this.manager;
}

private NotificationSettingImpl wrapModel(NotificationSettingInner inner) {
return new NotificationSettingImpl(inner, manager());
}

@Override
public Observable<NotificationSetting> listByResourceAsync(final String resourceGroupName, final String resourceNamespace, final String resourceType, final String resourceName) {
NotificationSettingsInner client = this.inner();
Expand All @@ -46,4 +50,16 @@ public NotificationSetting call(NotificationSettingInner inner) {
});
}

@Override
public Observable<NotificationSetting> getAsync(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) {
NotificationSettingsInner client = this.inner();
return client.getAsync(resourceGroupName, resourceNamespace, resourceType, resourceName)
.map(new Func1<NotificationSettingInner, NotificationSetting>() {
@Override
public NotificationSetting call(NotificationSettingInner inner) {
return new NotificationSettingImpl(inner, manager());
}
});
}

}
Loading