Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial set of API changes for Schema Registry #24285

Merged
merged 2 commits into from
Sep 28, 2021
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
10 changes: 5 additions & 5 deletions sdk/schemaregistry/Azure.Data.SchemaRegistry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Once you have the Azure resource credentials and the Event Hubs namespace hostna
// Create a new SchemaRegistry client using the default credential from Azure.Identity using environment variables previously set,
// including AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, and AZURE_TENANT_ID.
// For more information on Azure.Identity usage, see: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md
var client = new SchemaRegistryClient(endpoint: endpoint, credential: new DefaultAzureCredential());
var client = new SchemaRegistryClient(fullyQualifiedNamespace: endpoint, credential: new DefaultAzureCredential());
```

## Key concepts
Expand Down Expand Up @@ -90,7 +90,7 @@ Register a schema to be stored in the Azure Schema Registry. When registering a

```C# Snippet:SchemaRegistryRegisterSchema
string name = "employeeSample";
SerializationType type = SerializationType.Avro;
SchemaFormat format = SchemaFormat.Avro;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still see mentions of serialization type & content in the readme outside the code snippets.

// Example schema's content
string content = @"
{
Expand All @@ -103,7 +103,7 @@ string content = @"
]
}";

Response<SchemaProperties> schemaProperties = client.RegisterSchema(groupName, name, content, type);
Response<SchemaProperties> schemaProperties = client.RegisterSchema(groupName, name, content, format);
```

### Retrieve a schema ID
Expand All @@ -112,7 +112,7 @@ Retrieve a previously registered schema ID from the Azure Schema Registry. When

```C# Snippet:SchemaRegistryRetrieveSchemaId
string name = "employeeSample";
SerializationType type = SerializationType.Avro;
SchemaFormat format = SchemaFormat.Avro;
// Example schema's content
string content = @"
{
Expand All @@ -125,7 +125,7 @@ string content = @"
]
}";

SchemaProperties schemaProperties = client.GetSchemaProperties(groupName, name, content, type);
SchemaProperties schemaProperties = client.GetSchemaProperties(groupName, name, content, format);
string schemaId = schemaProperties.Id;
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
namespace Azure.Data.SchemaRegistry
{
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct SchemaFormat : System.IEquatable<Azure.Data.SchemaRegistry.SchemaFormat>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public SchemaFormat(string value) { throw null; }
public static Azure.Data.SchemaRegistry.SchemaFormat Avro { get { throw null; } }
public bool Equals(Azure.Data.SchemaRegistry.SchemaFormat other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static bool operator ==(Azure.Data.SchemaRegistry.SchemaFormat left, Azure.Data.SchemaRegistry.SchemaFormat right) { throw null; }
public static implicit operator Azure.Data.SchemaRegistry.SchemaFormat (string value) { throw null; }
public static bool operator !=(Azure.Data.SchemaRegistry.SchemaFormat left, Azure.Data.SchemaRegistry.SchemaFormat right) { throw null; }
public override string ToString() { throw null; }
}
public partial class SchemaProperties
{
internal SchemaProperties() { }
public Azure.Data.SchemaRegistry.SchemaFormat Format { get { throw null; } }
public string Id { get { throw null; } }
public Azure.Data.SchemaRegistry.SerializationType Type { get { throw null; } }
}
public partial class SchemaRegistryClient
{
protected SchemaRegistryClient() { }
public SchemaRegistryClient(string endpoint, Azure.Core.TokenCredential credential) { }
public SchemaRegistryClient(string endpoint, Azure.Core.TokenCredential credential, Azure.Data.SchemaRegistry.SchemaRegistryClientOptions options) { }
public virtual Azure.Data.SchemaRegistry.SchemaRegistrySchema GetSchema(string schemaId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.ValueTask<Azure.Data.SchemaRegistry.SchemaRegistrySchema> GetSchemaAsync(string schemaId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Data.SchemaRegistry.SchemaProperties GetSchemaProperties(string groupName, string name, string content, Azure.Data.SchemaRegistry.SerializationType serializationType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.ValueTask<Azure.Data.SchemaRegistry.SchemaProperties> GetSchemaPropertiesAsync(string groupName, string name, string content, Azure.Data.SchemaRegistry.SerializationType serializationType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties> RegisterSchema(string groupName, string name, string content, Azure.Data.SchemaRegistry.SerializationType serializationType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties>> RegisterSchemaAsync(string groupName, string name, string content, Azure.Data.SchemaRegistry.SerializationType serializationType, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public SchemaRegistryClient(string fullyQualifiedNamespace, Azure.Core.TokenCredential credential) { }
public SchemaRegistryClient(string fullyQualifiedNamespace, Azure.Core.TokenCredential credential, Azure.Data.SchemaRegistry.SchemaRegistryClientOptions options) { }
public string FullyQualifiedNamespace { get { throw null; } }
public virtual Azure.Response<Azure.Data.SchemaRegistry.SchemaRegistrySchema> GetSchema(string schemaId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Data.SchemaRegistry.SchemaRegistrySchema>> GetSchemaAsync(string schemaId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties> GetSchemaProperties(string groupName, string name, string schemaDefinition, Azure.Data.SchemaRegistry.SchemaFormat format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties>> GetSchemaPropertiesAsync(string groupName, string name, string schemaDefinition, Azure.Data.SchemaRegistry.SchemaFormat format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties> RegisterSchema(string groupName, string name, string schemaDefinition, Azure.Data.SchemaRegistry.SchemaFormat format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties>> RegisterSchemaAsync(string groupName, string name, string schemaDefinition, Azure.Data.SchemaRegistry.SchemaFormat format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class SchemaRegistryClientOptions : Azure.Core.ClientOptions
{
Expand All @@ -33,21 +51,4 @@ internal SchemaRegistrySchema() { }
public string Content { get { throw null; } }
public Azure.Data.SchemaRegistry.SchemaProperties Properties { get { throw null; } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct SerializationType : System.IEquatable<Azure.Data.SchemaRegistry.SerializationType>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public SerializationType(string value) { throw null; }
public static Azure.Data.SchemaRegistry.SerializationType Avro { get { throw null; } }
public bool Equals(Azure.Data.SchemaRegistry.SerializationType other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static bool operator ==(Azure.Data.SchemaRegistry.SerializationType left, Azure.Data.SchemaRegistry.SerializationType right) { throw null; }
public static implicit operator Azure.Data.SchemaRegistry.SerializationType (string value) { throw null; }
public static bool operator !=(Azure.Data.SchemaRegistry.SerializationType left, Azure.Data.SchemaRegistry.SerializationType right) { throw null; }
public override string ToString() { throw null; }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ namespace Azure.Data.SchemaRegistry
/// </summary>
public class SchemaProperties
{
internal SchemaProperties(string location, SerializationType xSchemaType, string xSchemaId, int? xSchemaVersion)
internal SchemaProperties(string location, SchemaFormat format, string schemaId, int? schemaVersion)
{
Id = xSchemaId;
Id = schemaId;
Location = location;
Type = xSchemaType;
Version = xSchemaVersion ?? 0;
Format = format;
Version = schemaVersion ?? 0;
}

/// <summary>
Expand All @@ -29,7 +29,7 @@ internal SchemaProperties(string location, SerializationType xSchemaType, string
/// <summary>
/// Serialization type for the schema being stored.
/// </summary>
public SerializationType Type { get; }
public SchemaFormat Format { get; }

/// <summary>
/// Version of the schema.
Expand Down
Loading