All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.toolkit.lib.cosmos.model.DatabaseAccountKeys Maven / Gradle / Ivy

There is a newer version: 0.48.0
Show newest version
/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 */

package com.microsoft.azure.toolkit.lib.cosmos.model;

import com.azure.resourcemanager.cosmos.models.DatabaseAccountListKeysResult;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.annotation.Nonnull;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
public class DatabaseAccountKeys {
    private String primaryMasterKey;
    private String secondaryMasterKey;
    private String primaryReadonlyMasterKey;
    private String secondaryReadonlyMasterKey;

    public static DatabaseAccountKeys fromDatabaseAccountListKeysResult(@Nonnull DatabaseAccountListKeysResult result) {
        return DatabaseAccountKeys.builder()
                .primaryMasterKey(result.primaryMasterKey())
                .secondaryMasterKey(result.secondaryMasterKey())
                .primaryReadonlyMasterKey(result.primaryReadonlyMasterKey())
                .secondaryReadonlyMasterKey(result.secondaryReadonlyMasterKey())
                .build();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy