Skip to content

Commit

Permalink
Merge pull request #9 from zoho/beta
Browse files Browse the repository at this point in the history
3.0.0
  • Loading branch information
raja-7453 committed Feb 27, 2024
2 parents f4d9c46 + d43cfb9 commit 4177513
Show file tree
Hide file tree
Showing 1,330 changed files with 141,858 additions and 20 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ License

## Latest Version

- [3.0.0](/versions/3.0.0/ZohoCRM/README.md)

- Changed favorite field datatype in CustomViews.
- Support for the following new APIs.
- CustomViews
- [Change Sort Order of Custom Views](https://www.zoho.com/crm/developer/docs/api/v6/sort-order-cv.html)
- Users
- [Users Count](https://www.zoho.com/crm/developer/docs/api/v6/users-count.html)
- Features
- [User Licences Count](https://www.zoho.com/crm/developer/docs/api/v6/get-user-licences.html)

- [2.0.0](/versions/2.0.0/ZohoCRM/README.md)

- C# SDK Fields meta handling in Utility class.
Expand Down Expand Up @@ -60,15 +71,15 @@ You can include the SDK to your project using:
- Package Manager

```sh
Install-Package ZOHOCRMSDK-6.0 -Version 2.0.0
Install-Package ZOHOCRMSDK-6.0 -Version 3.0.0
Install-Package MySql.Data -Version 6.9.12
Install-Package Newtonsoft.Json -Version 13.0.1
```

- .NET CLI

```sh
dotnet add package ZOHOCRMSDK-6.0 --version 2.0.0
dotnet add package ZOHOCRMSDK-6.0 --version 3.0.0
dotnet add package Newtonsoft.Json --version 13.0.1
dotnet add package MySql.Data --version 6.9.12
```
Expand All @@ -79,7 +90,7 @@ You can include the SDK to your project using:

```sh
<ItemGroup>
<PackageReference Include="ZOHOCRMSDK-6.0" Version="2.0.0" />
<PackageReference Include="ZOHOCRMSDK-6.0" Version="3.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="MySql.Data" Version="6.9.12" />
</ItemGroup>
Expand All @@ -99,4 +110,4 @@ For example, if you generate the tokens for your Sandbox environment in the CN d
---

For more details, kindly refer [here](/versions/2.0.0/ZohoCRM/README.md).
For more details, kindly refer [here](/versions/3.0.0/ZohoCRM/README.md).
2 changes: 1 addition & 1 deletion ZohoCRM/Com/Zoho/Crm/API/ChangeOwner/MassWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Com.Zoho.Crm.API.ChangeOwner
{

public class MassWrapper : BodyWrapper, Model
public class MassWrapper : BodyWrapper , Model
{
private List<long?> ids;
private Owner owner;
Expand Down
2 changes: 1 addition & 1 deletion ZohoCRM/Com/Zoho/Crm/API/CustomViews/ActionWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Com.Zoho.Crm.API.CustomViews
{

public class ActionWrapper : Model
public class ActionWrapper : Model, ActionHandler
{
private List<ActionResponse> customViews;
private Dictionary<string, int?> keyModified=new Dictionary<string, int?>();
Expand Down
8 changes: 4 additions & 4 deletions ZohoCRM/Com/Zoho/Crm/API/CustomViews/CustomViews.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CustomViews : Model
private bool? default1;
private bool? systemDefined;
private bool? locked;
private bool? favorite;
private int? favorite;
private bool? offline;
private Choice<string> accessType;
private List<SharedTo> sharedTo;
Expand Down Expand Up @@ -311,17 +311,17 @@ public Criteria Criteria
}
}

public bool? Favorite
public int? Favorite
{
/// <summary>The method to get the favorite</summary>
/// <returns>bool? representing the favorite</returns>
/// <returns>int? representing the favorite</returns>
get
{
return this.favorite;

}
/// <summary>The method to set the value to favorite</summary>
/// <param name="favorite">bool?</param>
/// <param name="favorite">int?</param>
set
{
this.favorite=value;
Expand Down
79 changes: 79 additions & 0 deletions ZohoCRM/Com/Zoho/Crm/API/CustomViews/CustomViewsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,79 @@ public APIResponse<ResponseHandler> GetCustomView(long? id, ParameterMap paramIn
return handlerInstance.APICall<ResponseHandler>(typeof(ResponseHandler), "application/json");


}

/// <summary>The method to change sort order of custom views</summary>
/// <param name="request">Instance of BodyWrapper</param>
/// <param name="paramInstance">Instance of ParameterMap</param>
/// <returns>Instance of APIResponse<ActionHandler></returns>
public APIResponse<ActionHandler> ChangeSortOrderOfCustomViews(BodyWrapper request, ParameterMap paramInstance)
{
CommonAPIHandler handlerInstance=new CommonAPIHandler();

string apiPath="";

apiPath=string.Concat(apiPath, "/crm/v6/settings/custom_views/actions/change_sort");

handlerInstance.APIPath=apiPath;

handlerInstance.HttpMethod=Constants.REQUEST_METHOD_PUT;

handlerInstance.CategoryMethod=Constants.REQUEST_CATEGORY_UPDATE;

handlerInstance.ContentType="application/json";

handlerInstance.Request=request;

handlerInstance.MandatoryChecker=true;

handlerInstance.Param=paramInstance;

return handlerInstance.APICall<ActionHandler>(typeof(ActionHandler), "application/json");


}

/// <summary>The method to change sort order of custom view</summary>
/// <param name="id">long?</param>
/// <param name="request">Instance of BodyWrapper</param>
/// <param name="paramInstance">Instance of ParameterMap</param>
/// <returns>Instance of APIResponse<ActionHandler></returns>
public APIResponse<ActionHandler> ChangeSortOrderOfCustomView(long? id, BodyWrapper request, ParameterMap paramInstance)
{
CommonAPIHandler handlerInstance=new CommonAPIHandler();

string apiPath="";

apiPath=string.Concat(apiPath, "/crm/v6/settings/custom_views/");

apiPath=string.Concat(apiPath, id.ToString());

apiPath=string.Concat(apiPath, "/actions/change_sort");

handlerInstance.APIPath=apiPath;

handlerInstance.HttpMethod=Constants.REQUEST_METHOD_PUT;

handlerInstance.CategoryMethod=Constants.REQUEST_CATEGORY_UPDATE;

handlerInstance.ContentType="application/json";

handlerInstance.Request=request;

handlerInstance.Param=paramInstance;

return handlerInstance.APICall<ActionHandler>(typeof(ActionHandler), "application/json");


}


public static class GetCustomViewsParam
{
public static readonly Param<string> MODULE=new Param<string>("module", "com.zoho.crm.api.CustomViews.GetCustomViewsParam");
public static readonly Param<int?> PAGE=new Param<int?>("page", "com.zoho.crm.api.CustomViews.GetCustomViewsParam");
public static readonly Param<int?> PER_PAGE=new Param<int?>("per_page", "com.zoho.crm.api.CustomViews.GetCustomViewsParam");
}


Expand All @@ -69,5 +136,17 @@ public static class GetCustomViewParam
public static readonly Param<string> MODULE=new Param<string>("module", "com.zoho.crm.api.CustomViews.GetCustomViewParam");
}


public static class ChangeSortOrderOfCustomViewsParam
{
public static readonly Param<string> MODULE=new Param<string>("module", "com.zoho.crm.api.CustomViews.ChangeSortOrderOfCustomViewsParam");
}


public static class ChangeSortOrderOfCustomViewParam
{
public static readonly Param<string> MODULE=new Param<string>("module", "com.zoho.crm.api.CustomViews.ChangeSortOrderOfCustomViewParam");
}

}
}
21 changes: 21 additions & 0 deletions ZohoCRM/Com/Zoho/Crm/API/Features/Detail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,31 @@ namespace Com.Zoho.Crm.API.Features

public class Detail : Model
{
private Limit availableCount;
private Limit limits;
private Limit usedCount;
private Dictionary<string, int?> keyModified=new Dictionary<string, int?>();

public Limit AvailableCount
{
/// <summary>The method to get the availableCount</summary>
/// <returns>Instance of Limit</returns>
get
{
return this.availableCount;

}
/// <summary>The method to set the value to availableCount</summary>
/// <param name="availableCount">Instance of Limit</param>
set
{
this.availableCount=value;

this.keyModified["available_count"] = 1;

}
}

public Limit Limits
{
/// <summary>The method to get the limits</summary>
Expand Down
21 changes: 21 additions & 0 deletions ZohoCRM/Com/Zoho/Crm/API/Features/FeaturesOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,27 @@ public APIResponse<ResponseHandler> GetDataEnrichment()
return handlerInstance.APICall<ResponseHandler>(typeof(ResponseHandler), "application/json");


}

/// <summary>The method to get user licences count</summary>
/// <returns>Instance of APIResponse<ResponseHandler></returns>
public APIResponse<ResponseHandler> GetUserLicencesCount()
{
CommonAPIHandler handlerInstance=new CommonAPIHandler();

string apiPath="";

apiPath=string.Concat(apiPath, "/crm/v6/__features/user_licenses");

handlerInstance.APIPath=apiPath;

handlerInstance.HttpMethod=Constants.REQUEST_METHOD_GET;

handlerInstance.CategoryMethod=Constants.REQUEST_CATEGORY_READ;

return handlerInstance.APICall<ResponseHandler>(typeof(ResponseHandler), "application/json");


}


Expand Down
2 changes: 1 addition & 1 deletion ZohoCRM/Com/Zoho/Crm/API/Users/APIException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Com.Zoho.Crm.API.Users
{

public class APIException : Model, ActionResponse, ResponseHandler, ActionHandler
public class APIException : Model, ActionResponse, ResponseHandler, ActionHandler, CountHandler
{
private Choice<string> code;
private Dictionary<string, object> details;
Expand Down
7 changes: 7 additions & 0 deletions ZohoCRM/Com/Zoho/Crm/API/Users/CountHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Com.Zoho.Crm.API.Users
{

public interface CountHandler
{
}
}
59 changes: 59 additions & 0 deletions ZohoCRM/Com/Zoho/Crm/API/Users/CountWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Com.Zoho.Crm.API.Util;
using System.Collections.Generic;

namespace Com.Zoho.Crm.API.Users
{

public class CountWrapper : Model, CountHandler
{
private long? count;
private Dictionary<string, int?> keyModified=new Dictionary<string, int?>();

public long? Count
{
/// <summary>The method to get the count</summary>
/// <returns>long? representing the count</returns>
get
{
return this.count;

}
/// <summary>The method to set the value to count</summary>
/// <param name="count">long?</param>
set
{
this.count=value;

this.keyModified["count"] = 1;

}
}

/// <summary>The method to check if the user has modified the given key</summary>
/// <param name="key">string</param>
/// <returns>int? representing the modification</returns>
public int? IsKeyModified(string key)
{
if((( this.keyModified.ContainsKey(key))))
{
return this.keyModified[key];

}
return null;


}

/// <summary>The method to mark the given key as modified</summary>
/// <param name="key">string</param>
/// <param name="modification">int?</param>
public void SetKeyModified(string key, int? modification)
{
this.keyModified[key] = modification;


}


}
}
30 changes: 30 additions & 0 deletions ZohoCRM/Com/Zoho/Crm/API/Users/UsersOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,30 @@ public APIResponse<ResponseHandler> GetAssociatedGroups(long? user)
return handlerInstance.APICall<ResponseHandler>(typeof(ResponseHandler), "application/json");


}

/// <summary>The method to users count</summary>
/// <param name="paramInstance">Instance of ParameterMap</param>
/// <returns>Instance of APIResponse<CountHandler></returns>
public APIResponse<CountHandler> UsersCount(ParameterMap paramInstance)
{
CommonAPIHandler handlerInstance=new CommonAPIHandler();

string apiPath="";

apiPath=string.Concat(apiPath, "/crm/v6/users/actions/count");

handlerInstance.APIPath=apiPath;

handlerInstance.HttpMethod=Constants.REQUEST_METHOD_GET;

handlerInstance.CategoryMethod=Constants.REQUEST_CATEGORY_READ;

handlerInstance.Param=paramInstance;

return handlerInstance.APICall<CountHandler>(typeof(CountHandler), "application/json");


}


Expand All @@ -219,5 +243,11 @@ public static class GetUserHeader
public static readonly Header<DateTimeOffset?> IF_MODIFIED_SINCE=new Header<DateTimeOffset?>("If-Modified-Since", "com.zoho.crm.api.Users.GetUserHeader");
}


public static class UsersCountParam
{
public static readonly Param<Choice<string>> TYPE=new Param<Choice<string>>("type", "com.zoho.crm.api.Users.UsersCountParam");
}

}
}
2 changes: 1 addition & 1 deletion ZohoCRM/Com/Zoho/Crm/API/Util/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static class Constants
public static readonly string LOG_FILE_NAME = "sdk_logs.log";
public static readonly string TOKEN_FILE = "sdk_tokens.txt";
public static readonly string ZOHO_SDK = "X-ZOHO-SDK";
public static readonly string SDK_VERSION = "2.0.0";
public static readonly string SDK_VERSION = "3.0.0";
public static readonly string MODULEPACKAGENAME = "modulePackageName";
public static readonly string MODULEDETAILS = "moduleDetails";
public static readonly string DATATYPECONVERTER = "Com.Zoho.Crm.API.Util.DataTypeConverter`1[[$type]], ZOHOCRMSDK-6.0";
Expand Down

0 comments on commit 4177513

Please sign in to comment.