Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
move AzureProfile to com.azure.core.models
  • Loading branch information
XiaofeiCao committed Nov 27, 2024
commit 3bdeaaf8beb9e0d15a7bc53c95f936376949ed12
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// Licensed under the MIT License.
package com.azure.core.management.profile;

import com.azure.core.AzureCloud;
import com.azure.core.management.AzureEnvironment;
import com.azure.core.models.AzureCloud;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;

import java.util.HashMap;
import java.util.Map;
Expand All @@ -14,6 +15,7 @@
* Azure profile for client.
*/
public final class AzureProfile {
private static final ClientLogger LOGGER = new ClientLogger(AzureProfile.class);

private final String tenantId;
private final String subscriptionId;
Expand Down Expand Up @@ -130,8 +132,8 @@ public AzureEnvironment getEnvironment() {
private AzureEnvironment fromAzureCloud(AzureCloud azureCloud) {
AzureEnvironment azureEnvironment = ENDPOINT_MAP.get(azureCloud);
if (azureEnvironment == null) {
throw new IllegalArgumentException(
String.format("No endpoint mapping defined for AzureCloud: [%s].", azureCloud));
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("No endpoint mapping defined for AzureCloud: [%s].", azureCloud)));
}
return azureEnvironment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package com.azure.core.management;

import com.azure.core.AzureCloud;
import com.azure.core.models.AzureCloud;
import com.azure.core.management.profile.AzureProfile;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.core;
package com.azure.core.models;

import com.azure.core.util.ExpandableStringEnum;

Expand Down
2 changes: 0 additions & 2 deletions sdk/core/azure-core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
requires transitive com.fasterxml.jackson.datatype.jsr310;

// public API surface area
exports com.azure.core;
exports com.azure.core.annotation;
exports com.azure.core.client.traits;
exports com.azure.core.credential;
Expand Down Expand Up @@ -50,7 +49,6 @@
exports com.azure.core.util.polling.implementation to com.azure.core.experimental;

// exporting some packages specifically for Jackson
opens com.azure.core to com.fasterxml.jackson.databind;
opens com.azure.core.credential to com.fasterxml.jackson.databind;
opens com.azure.core.http to com.fasterxml.jackson.databind;
opens com.azure.core.models to com.fasterxml.jackson.databind;
Expand Down
Loading