Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/**
* 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.sql.v2017_03_01_preview;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.sql.v2017_03_01_preview.implementation.ManagedInstanceAdministratorInner;
import com.microsoft.azure.arm.model.Indexable;
import com.microsoft.azure.arm.model.Refreshable;
import com.microsoft.azure.arm.model.Updatable;
import com.microsoft.azure.arm.model.Appliable;
import com.microsoft.azure.arm.model.Creatable;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.sql.v2017_03_01_preview.implementation.SqlManager;
import java.util.UUID;

/**
* Type representing ManagedInstanceAdministrator.
*/
public interface ManagedInstanceAdministrator extends HasInner<ManagedInstanceAdministratorInner>, Indexable, Refreshable<ManagedInstanceAdministrator>, Updatable<ManagedInstanceAdministrator.Update>, HasManager<SqlManager> {
/**
* @return the administratorType value.
*/
String administratorType();

/**
* @return the id value.
*/
String id();

/**
* @return the login value.
*/
String login();

/**
* @return the name value.
*/
String name();

/**
* @return the sid value.
*/
UUID sid();

/**
* @return the tenantId value.
*/
UUID tenantId();

/**
* @return the type value.
*/
String type();

/**
* The entirety of the ManagedInstanceAdministrator definition.
*/
interface Definition extends DefinitionStages.Blank, DefinitionStages.WithManagedInstance, DefinitionStages.WithAdministratorType, DefinitionStages.WithLogin, DefinitionStages.WithSid, DefinitionStages.WithCreate {
}

/**
* Grouping of ManagedInstanceAdministrator definition stages.
*/
interface DefinitionStages {
/**
* The first stage of a ManagedInstanceAdministrator definition.
*/
interface Blank extends WithManagedInstance {
}

/**
* The stage of the managedinstanceadministrator definition allowing to specify ManagedInstance.
*/
interface WithManagedInstance {
/**
* Specifies resourceGroupName, managedInstanceName.
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal
* @param managedInstanceName The name of the managed instance
* @return the next definition stage
*/
WithAdministratorType withExistingManagedInstance(String resourceGroupName, String managedInstanceName);
}

/**
* The stage of the managedinstanceadministrator definition allowing to specify AdministratorType.
*/
interface WithAdministratorType {
/**
* Specifies administratorType.
* @param administratorType Type of the managed instance administrator
* @return the next definition stage
*/
WithLogin withAdministratorType(String administratorType);
}

/**
* The stage of the managedinstanceadministrator definition allowing to specify Login.
*/
interface WithLogin {
/**
* Specifies login.
* @param login Login name of the managed instance administrator
* @return the next definition stage
*/
WithSid withLogin(String login);
}

/**
* The stage of the managedinstanceadministrator definition allowing to specify Sid.
*/
interface WithSid {
/**
* Specifies sid.
* @param sid SID (object ID) of the managed instance administrator
* @return the next definition stage
*/
WithCreate withSid(UUID sid);
}

/**
* The stage of the managedinstanceadministrator definition allowing to specify TenantId.
*/
interface WithTenantId {
/**
* Specifies tenantId.
* @param tenantId Tenant ID of the managed instance administrator
* @return the next definition stage
*/
WithCreate withTenantId(UUID tenantId);
}

/**
* The stage of the definition which contains all the minimum required inputs for
* the resource to be created (via {@link WithCreate#create()}), but also allows
* for any other optional settings to be specified.
*/
interface WithCreate extends Creatable<ManagedInstanceAdministrator>, DefinitionStages.WithTenantId {
}
}
/**
* The template for a ManagedInstanceAdministrator update operation, containing all the settings that can be modified.
*/
interface Update extends Appliable<ManagedInstanceAdministrator>, UpdateStages.WithTenantId {
}

/**
* Grouping of ManagedInstanceAdministrator update stages.
*/
interface UpdateStages {
/**
* The stage of the managedinstanceadministrator update allowing to specify TenantId.
*/
interface WithTenantId {
/**
* Specifies tenantId.
* @param tenantId Tenant ID of the managed instance administrator
* @return the next update stage
*/
Update withTenantId(UUID tenantId);
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* 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.sql.v2017_03_01_preview;

import rx.Observable;
import com.microsoft.azure.management.sql.v2017_03_01_preview.ManagedInstanceAdministrator;
import rx.Completable;

/**
* Type representing ManagedInstanceAdministrators.
*/
public interface ManagedInstanceAdministrators {
/**
* Begins definition for a new Administrator resource.
* @param name resource name.
* @return the first stage of the new Administrator definition.
*/
ManagedInstanceAdministrator.DefinitionStages.Blank defineAdministrator(String name);

/**
* Gets a managed instance administrator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
* @param managedInstanceName The name of the managed instance.
* @param administratorName The administrator name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ManagedInstanceAdministrator> getAsync(String resourceGroupName, String managedInstanceName, String administratorName);

/**
* Gets a list of managed instance administrators.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
* @param managedInstanceName The name of the managed instance.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<ManagedInstanceAdministrator> listByInstanceAsync(final String resourceGroupName, final String managedInstanceName);

/**
* Deletes a managed instance administrator.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
* @param managedInstanceName The name of the managed instance.
* @param administratorName The administrator name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Completable deleteAsync(String resourceGroupName, String managedInstanceName, String administratorName);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/**
* 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.sql.v2017_03_01_preview.implementation;

import com.microsoft.azure.management.sql.v2017_03_01_preview.ManagedInstanceAdministrator;
import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl;
import rx.Observable;
import java.util.UUID;

class ManagedInstanceAdministratorImpl extends CreatableUpdatableImpl<ManagedInstanceAdministrator, ManagedInstanceAdministratorInner, ManagedInstanceAdministratorImpl> implements ManagedInstanceAdministrator, ManagedInstanceAdministrator.Definition, ManagedInstanceAdministrator.Update {
private final SqlManager manager;
private String resourceGroupName;
private String managedInstanceName;
private String administratorName;

ManagedInstanceAdministratorImpl(String name, SqlManager manager) {
super(name, new ManagedInstanceAdministratorInner());
this.manager = manager;
// Set resource name
this.administratorName = name;
//
}

ManagedInstanceAdministratorImpl(ManagedInstanceAdministratorInner inner, SqlManager manager) {
super(inner.name(), inner);
this.manager = manager;
// Set resource name
this.administratorName = inner.name();
// set resource ancestor and positional variables
this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups");
this.managedInstanceName = IdParsingUtils.getValueFromIdByName(inner.id(), "managedInstances");
this.administratorName = IdParsingUtils.getValueFromIdByName(inner.id(), "administrators");
//
}

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

@Override
public Observable<ManagedInstanceAdministrator> createResourceAsync() {
ManagedInstanceAdministratorsInner client = this.manager().inner().managedInstanceAdministrators();
return client.createOrUpdateAsync(this.resourceGroupName, this.managedInstanceName, this.administratorName, this.inner())
.map(innerToFluentMap(this));
}

@Override
public Observable<ManagedInstanceAdministrator> updateResourceAsync() {
ManagedInstanceAdministratorsInner client = this.manager().inner().managedInstanceAdministrators();
return client.createOrUpdateAsync(this.resourceGroupName, this.managedInstanceName, this.administratorName, this.inner())
.map(innerToFluentMap(this));
}

@Override
protected Observable<ManagedInstanceAdministratorInner> getInnerAsync() {
ManagedInstanceAdministratorsInner client = this.manager().inner().managedInstanceAdministrators();
return client.getAsync(this.resourceGroupName, this.managedInstanceName, this.administratorName);
}

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


@Override
public String administratorType() {
return this.inner().administratorType();
}

@Override
public String id() {
return this.inner().id();
}

@Override
public String login() {
return this.inner().login();
}

@Override
public String name() {
return this.inner().name();
}

@Override
public UUID sid() {
return this.inner().sid();
}

@Override
public UUID tenantId() {
return this.inner().tenantId();
}

@Override
public String type() {
return this.inner().type();
}

@Override
public ManagedInstanceAdministratorImpl withExistingManagedInstance(String resourceGroupName, String managedInstanceName) {
this.resourceGroupName = resourceGroupName;
this.managedInstanceName = managedInstanceName;
return this;
}

@Override
public ManagedInstanceAdministratorImpl withAdministratorType(String administratorType) {
this.inner().withAdministratorType(administratorType);
return this;
}

@Override
public ManagedInstanceAdministratorImpl withLogin(String login) {
this.inner().withLogin(login);
return this;
}

@Override
public ManagedInstanceAdministratorImpl withSid(UUID sid) {
this.inner().withSid(sid);
return this;
}

@Override
public ManagedInstanceAdministratorImpl withTenantId(UUID tenantId) {
this.inner().withTenantId(tenantId);
return this;
}

}
Loading