Skip to content

Commit

Permalink
Initial set of API changes for Schema Registry (#24285)
Browse files Browse the repository at this point in the history
* Initial set of API changes for Schema Registry

* PR fb
  • Loading branch information
JoshLove-msft authored Sep 28, 2021
1 parent 4a63bde commit 7c0f565
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 215 deletions.
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: fullyQualifiedNamespace, 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;
// 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 @@ -9,7 +9,7 @@ namespace Azure.Data.SchemaRegistry
/// The format used when serializing SchemaRegistry messages.
/// </summary>
[CodeGenModel("SerializationType")]
public readonly partial struct SerializationType
public readonly partial struct SchemaFormat
{
}
}
Loading

0 comments on commit 7c0f565

Please sign in to comment.