Skip to content

Commit

Permalink
Sync with dub api
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlphamerc committed Apr 27, 2024
1 parent 17326b9 commit e88f509
Show file tree
Hide file tree
Showing 19 changed files with 151 additions and 901 deletions.
3 changes: 0 additions & 3 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ doc/DeleteLink200Response.md
doc/DomainSchema.md
doc/DomainsApi.md
doc/EditDomainRequest.md
doc/EditLinkRequest.md
doc/GetBrowserAnalytics200ResponseInner.md
doc/GetCityAnalytics200ResponseInner.md
doc/GetCountryAnalytics200ResponseInner.md
Expand Down Expand Up @@ -78,7 +77,6 @@ lib/src/model/delete_domain200_response.dart
lib/src/model/delete_link200_response.dart
lib/src/model/domain_schema.dart
lib/src/model/edit_domain_request.dart
lib/src/model/edit_link_request.dart
lib/src/model/get_browser_analytics200_response_inner.dart
lib/src/model/get_city_analytics200_response_inner.dart
lib/src/model/get_country_analytics200_response_inner.dart
Expand Down Expand Up @@ -126,7 +124,6 @@ test/delete_link200_response_test.dart
test/domain_schema_test.dart
test/domains_api_test.dart
test/edit_domain_request_test.dart
test/edit_link_request_test.dart
test/get_browser_analytics200_response_inner_test.dart
test/get_city_analytics200_response_inner_test.dart
test/get_country_analytics200_response_inner_test.dart
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.1

- Initial version of dub package

## 0.0.2

- Added example usage
- Synced with latest version of `dub` api
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ Dub is link management infrastructure for companies to create marketing campaign

For more information, please visit [https://dub.co/api](https://dub.co/api)

## Requirements

- Dart 2.15.0+ or Flutter 2.8.0+
- Dio 5.0.0+ (https://pub.dev/packages/dio)
- JSON Serializable 6.1.5+ (https://pub.dev/packages/json_serializable)

## Installation & Usage

### pub.dev
Expand Down Expand Up @@ -129,7 +123,6 @@ All URIs are relative to *https://api.dub.co*
- [DeleteLink200Response](doc/DeleteLink200Response.md)
- [DomainSchema](doc/DomainSchema.md)
- [EditDomainRequest](doc/EditDomainRequest.md)
- [EditLinkRequest](doc/EditLinkRequest.md)
- [GetBrowserAnalytics200ResponseInner](doc/GetBrowserAnalytics200ResponseInner.md)
- [GetCityAnalytics200ResponseInner](doc/GetCityAnalytics200ResponseInner.md)
- [GetCountryAnalytics200ResponseInner](doc/GetCountryAnalytics200ResponseInner.md)
Expand Down
36 changes: 0 additions & 36 deletions doc/EditLinkRequest.md

This file was deleted.

36 changes: 18 additions & 18 deletions doc/LinksApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Method | HTTP request | Description


# **bulkCreateLinks**
> List<LinkSchema> bulkCreateLinks(workspaceId, projectSlug, editLinkRequest)
> List<LinkSchema> bulkCreateLinks(workspaceId, projectSlug, createLinkRequest)
Bulk create links

Expand All @@ -32,10 +32,10 @@ import 'package:dub/api.dart';
final api = Dub().getLinksApi();
final String workspaceId = ws_cluuwcv0r...; // String | The ID of the workspace.
final String projectSlug = projectSlug_example; // String | The slug of the project. This field is deprecated – use `workspaceId` instead.
final List<EditLinkRequest> editLinkRequest = ; // List<EditLinkRequest> |
final List<CreateLinkRequest> createLinkRequest = ; // List<CreateLinkRequest> |
try {
final response = api.bulkCreateLinks(workspaceId, projectSlug, editLinkRequest);
final response = api.bulkCreateLinks(workspaceId, projectSlug, createLinkRequest);
print(response);
} catch on DioException (e) {
print('Exception when calling LinksApi->bulkCreateLinks: $e\n');
Expand All @@ -48,7 +48,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**workspaceId** | **String**| The ID of the workspace. |
**projectSlug** | **String**| The slug of the project. This field is deprecated – use `workspaceId` instead. | [optional]
**editLinkRequest** | [**List&lt;EditLinkRequest&gt;**](EditLinkRequest.md)| | [optional]
**createLinkRequest** | [**List&lt;CreateLinkRequest&gt;**](CreateLinkRequest.md)| | [optional]

### Return type

Expand Down Expand Up @@ -160,7 +160,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **editLink**
> LinkSchema editLink(linkId, workspaceId, projectSlug, editLinkRequest)
> LinkSchema editLink(linkId, workspaceId, projectSlug, createLinkRequest)
Edit a link

Expand All @@ -174,10 +174,10 @@ final api = Dub().getLinksApi();
final String linkId = linkId_example; // String | The id of the link to edit. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`.
final String workspaceId = ws_cluuwcv0r...; // String | The ID of the workspace.
final String projectSlug = projectSlug_example; // String | The slug of the project. This field is deprecated – use `workspaceId` instead.
final EditLinkRequest editLinkRequest = ; // EditLinkRequest |
final CreateLinkRequest createLinkRequest = ; // CreateLinkRequest |
try {
final response = api.editLink(linkId, workspaceId, projectSlug, editLinkRequest);
final response = api.editLink(linkId, workspaceId, projectSlug, createLinkRequest);
print(response);
} catch on DioException (e) {
print('Exception when calling LinksApi->editLink: $e\n');
Expand All @@ -191,7 +191,7 @@ Name | Type | Description | Notes
**linkId** | **String**| The id of the link to edit. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. |
**workspaceId** | **String**| The ID of the workspace. |
**projectSlug** | **String**| The slug of the project. This field is deprecated – use `workspaceId` instead. | [optional]
**editLinkRequest** | [**EditLinkRequest**](EditLinkRequest.md)| | [optional]
**createLinkRequest** | [**CreateLinkRequest**](CreateLinkRequest.md)| | [optional]

### Return type

Expand Down Expand Up @@ -273,8 +273,8 @@ final String workspaceId = ws_cluuwcv0r...; // String | The ID of the workspace.
final String projectSlug = projectSlug_example; // String | The slug of the project. This field is deprecated – use `workspaceId` instead.
final String domain = domain_example; // String | The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned.
final String tagId = tagId_example; // String | The tag ID to filter the links by. This field is deprecated – use `tagIds` instead.
final String tagIds = tagIds_example; // String | The tag IDs to filter the links by.
final String tagNames = tagNames_example; // String | The unique name of the tags assigned to the short link (case insensitive).
final List<String> tagIds = ; // List<String> | The tag IDs to filter the links by.
final List<String> tagNames = ; // List<String> | The unique name of the tags assigned to the short link (case insensitive).
final String search = search_example; // String | The search term to filter the links by. The search term will be matched against the short link slug and the destination url.
final String userId = userId_example; // String | The user ID to filter the links by.
final bool showArchived = true; // bool | Whether to include archived links in the response. Defaults to `false` if not provided.
Expand All @@ -298,8 +298,8 @@ Name | Type | Description | Notes
**projectSlug** | **String**| The slug of the project. This field is deprecated – use `workspaceId` instead. | [optional]
**domain** | **String**| The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned. | [optional]
**tagId** | **String**| The tag ID to filter the links by. This field is deprecated – use `tagIds` instead. | [optional]
**tagIds** | **String**| The tag IDs to filter the links by. | [optional]
**tagNames** | **String**| The unique name of the tags assigned to the short link (case insensitive). | [optional]
**tagIds** | [**List&lt;String&gt;**](String.md)| The tag IDs to filter the links by. | [optional]
**tagNames** | [**List&lt;String&gt;**](String.md)| The unique name of the tags assigned to the short link (case insensitive). | [optional]
**search** | **String**| The search term to filter the links by. The search term will be matched against the short link slug and the destination url. | [optional]
**userId** | **String**| The user ID to filter the links by. | [optional]
**showArchived** | **bool**| Whether to include archived links in the response. Defaults to `false` if not provided. | [optional] [default to false]
Expand Down Expand Up @@ -338,13 +338,13 @@ final String workspaceId = ws_cluuwcv0r...; // String | The ID of the workspace.
final String projectSlug = projectSlug_example; // String | The slug of the project. This field is deprecated – use `workspaceId` instead.
final String domain = domain_example; // String | The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned.
final String tagId = tagId_example; // String | The tag ID to filter the links by. This field is deprecated – use `tagIds` instead.
final String tagIds = tagIds_example; // String | The tag IDs to filter the links by.
final String tagNames = tagNames_example; // String | The unique name of the tags assigned to the short link (case insensitive).
final List<String> tagIds = ; // List<String> | The tag IDs to filter the links by.
final List<String> tagNames = ; // List<String> | The unique name of the tags assigned to the short link (case insensitive).
final String search = search_example; // String | The search term to filter the links by. The search term will be matched against the short link slug and the destination url.
final String userId = userId_example; // String | The user ID to filter the links by.
final bool showArchived = true; // bool | Whether to include archived links in the response. Defaults to `false` if not provided.
final bool withTags = true; // bool | Whether to include tags in the response. Defaults to `false` if not provided.
final String groupBy = groupBy_example; // String | The field to group the links by.
final List<String> groupBy = ; // List<String> | The field to group the links by.
try {
final response = api.getLinksCount(workspaceId, projectSlug, domain, tagId, tagIds, tagNames, search, userId, showArchived, withTags, groupBy);
Expand All @@ -362,13 +362,13 @@ Name | Type | Description | Notes
**projectSlug** | **String**| The slug of the project. This field is deprecated – use `workspaceId` instead. | [optional]
**domain** | **String**| The domain to filter the links by. E.g. `ac.me`. If not provided, all links for the workspace will be returned. | [optional]
**tagId** | **String**| The tag ID to filter the links by. This field is deprecated – use `tagIds` instead. | [optional]
**tagIds** | **String**| The tag IDs to filter the links by. | [optional]
**tagNames** | **String**| The unique name of the tags assigned to the short link (case insensitive). | [optional]
**tagIds** | [**List&lt;String&gt;**](String.md)| The tag IDs to filter the links by. | [optional]
**tagNames** | [**List&lt;String&gt;**](String.md)| The unique name of the tags assigned to the short link (case insensitive). | [optional]
**search** | **String**| The search term to filter the links by. The search term will be matched against the short link slug and the destination url. | [optional]
**userId** | **String**| The user ID to filter the links by. | [optional]
**showArchived** | **bool**| Whether to include archived links in the response. Defaults to `false` if not provided. | [optional] [default to false]
**withTags** | **bool**| Whether to include tags in the response. Defaults to `false` if not provided. | [optional] [default to false]
**groupBy** | **String**| The field to group the links by. | [optional]
**groupBy** | [**List&lt;String&gt;**](String.md)| The field to group the links by. | [optional]

### Return type

Expand Down
1 change: 0 additions & 1 deletion example/lib/help-page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class HelpPage extends StatelessWidget {
const HelpPage({super.key});
Expand Down
1 change: 0 additions & 1 deletion example/lib/my-short-links.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:example/widget/link-detail-card.dart';
import 'package:example/widget/title_action_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:url_launcher/url_launcher.dart';

class MyShortLinks extends StatefulWidget {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/widget/create_link_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class _CreateLinkCArdState extends State<CreateLinkCArd> {
onPressed: () {
if (link?.shortLink != null) {
Clipboard.setData(
ClipboardData(text: link!.shortLink!));
ClipboardData(text: link!.shortLink));
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Copied to clipboard'),
Expand Down
1 change: 0 additions & 1 deletion lib/dub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export 'package:dub/src/model/delete_domain200_response.dart';
export 'package:dub/src/model/delete_link200_response.dart';
export 'package:dub/src/model/domain_schema.dart';
export 'package:dub/src/model/edit_domain_request.dart';
export 'package:dub/src/model/edit_link_request.dart';
export 'package:dub/src/model/get_browser_analytics200_response_inner.dart';
export 'package:dub/src/model/get_city_analytics200_response_inner.dart';
export 'package:dub/src/model/get_country_analytics200_response_inner.dart';
Expand Down
Loading

0 comments on commit e88f509

Please sign in to comment.