Skip to content

Commit

Permalink
Merge pull request #18 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
Add GetAllPermissionsBy
  • Loading branch information
Ali-YousefiTelori authored Oct 22, 2023
2 parents 07a9b83 + 74af2fc commit e074f5d
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 52 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/dotnet-format-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- name: Install Android
run: dotnet workload install android
Expand All @@ -28,9 +25,7 @@ jobs:
workspace: "./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln"
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln -f netcoreapp3.1
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln -f net6.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln -f net5.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln -f net7.0
- name: Commit files
if: steps.format.outputs.has-changes == 'true'
uses: EndBug/[email protected]
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/dotnet-linux-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- name: Install Android
run: dotnet workload install android
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-restore
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-build --verbosity normal -f netcoreapp3.1
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-build --verbosity normal -f net6.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-build --verbosity normal -f net5.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-build --verbosity normal -f net7.0
9 changes: 1 addition & 8 deletions .github/workflows/dotnet-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- name: Install Android
run: dotnet workload install android
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-restore
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f netcoreapp3.1
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net6.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net5.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net7.0
9 changes: 1 addition & 8 deletions .github/workflows/dotnet-macos-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- name: Install Android
run: dotnet workload install android
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-restore
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-build --verbosity normal -f netcoreapp3.1
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-build --verbosity normal -f net6.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-build --verbosity normal -f net5.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln --no-build --verbosity normal -f net7.0
9 changes: 1 addition & 8 deletions .github/workflows/dotnet-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,11 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- name: Install Android
run: dotnet workload install android
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-restore
- name: Test
run: |
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f netcoreapp3.1
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net6.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net5.0
dotnet test ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln --no-build --verbosity normal -f net7.0
2 changes: 0 additions & 2 deletions .github/workflows/dotnet-windows-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
5.0.x
6.0.x
7.0.x
- name: Install Android
run: dotnet workload install android
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.Client.sln
- name: Build
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/dotnet-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
- name: Install Android
run: dotnet workload install android
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.AuthenticationsMicroservice.sln
- name: Build
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/nuget-push-public-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ jobs:
- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
env:
DOTNET_INSTALL_DIR: /usr/share/dotnet
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/nuget-push-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ jobs:
- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
env:
DOTNET_INSTALL_DIR: /usr/share/dotnet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2349,6 +2349,84 @@ public string BaseUrl
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);

/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<ServicePermissionContractListMessageContract> GetAllPermissionsByAsync(ServicePermissionRequestContract body)
{
return GetAllPermissionsByAsync(body, System.Threading.CancellationToken.None);
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<ServicePermissionContractListMessageContract> GetAllPermissionsByAsync(ServicePermissionRequestContract body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/ServicePermission/GetAllPermissionsBy");

var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));

PrepareRequest(client_, request_, urlBuilder_);

var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

PrepareRequest(client_, request_, url_);

var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}

ProcessResponse(client_, response_);

var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<ServicePermissionContractListMessageContract>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}

/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<Int64MessageContract> AddAsync(AddServicePermissionRequestContract body)
Expand Down Expand Up @@ -8516,6 +8594,52 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal
}
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
public partial class ServicePermissionRequestContract : System.ComponentModel.INotifyPropertyChanged
{
private string _roleName;
private string _microserviceName;

[Newtonsoft.Json.JsonProperty("roleName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string RoleName
{
get { return _roleName; }

set
{
if (_roleName != value)
{
_roleName = value;
RaisePropertyChanged();
}
}
}

[Newtonsoft.Json.JsonProperty("microserviceName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string MicroserviceName
{
get { return _microserviceName; }

set
{
if (_microserviceName != value)
{
_microserviceName = value;
RaisePropertyChanged();
}
}
}

public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")]
public partial class SuccessContract : System.ComponentModel.INotifyPropertyChanged
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,55 @@
}
}
},
"/api/ServicePermission/GetAllPermissionsBy": {
"post": {
"tags": [
"ServicePermission"
],
"operationId": "GetAllPermissionsBy",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServicePermissionRequestContract"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ServicePermissionRequestContract"
}
},
"application/*+json": {
"schema": {
"$ref": "#/components/schemas/ServicePermissionRequestContract"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/ServicePermissionContractListMessageContract"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServicePermissionContractListMessageContract"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ServicePermissionContractListMessageContract"
}
}
}
}
}
}
},
"/api/ServicePermission/Add": {
"post": {
"tags": [
Expand Down Expand Up @@ -4164,6 +4213,20 @@
}
}
},
"ServicePermissionRequestContract": {
"type": "object",
"additionalProperties": false,
"properties": {
"roleName": {
"type": "string",
"nullable": true
},
"microserviceName": {
"type": "string",
"nullable": true
}
}
},
"SuccessContract": {
"type": "object",
"additionalProperties": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>0.0.0.9</Version>
<Version>0.0.0.10</Version>
<Description>client generated code.</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>microservice,auth,authentication,client</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace EasyMicroservices.AuthenticationsMicroservice.Contracts.Requests
{
/// <summary>
///
/// </summary>
public class ServicePermissionRequestContract
{
public string RoleName { get; set; }
public string MicroserviceName { get; set; }
}
}
Loading

0 comments on commit e074f5d

Please sign in to comment.