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

Latest schema #9

Merged
merged 4 commits into from
Jan 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.5.0
- Update to the latest API schemas

## 0.4.0
- Allow some operations to take a `MultipartFile` as `body`

Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ See [Atlassian documentation of the APIs](https://developer.atlassian.com/cloud/
```dart
import 'dart:io';
import 'package:atlassian_apis/jira_platform.dart';
import 'package:atlassian_apis/service_management.dart';

void main() async {
// This example uses API Token authentication.
Expand Down Expand Up @@ -47,7 +46,6 @@ void main() async {
```dart
import 'dart:convert';
import 'package:atlassian_apis/jira_platform.dart';
import 'package:atlassian_apis/service_management.dart';

void main() async {
// Create Jira API from an authenticated client
Expand All @@ -66,7 +64,6 @@ void main() async {
import 'dart:convert';
import 'dart:io';
import 'package:atlassian_apis/service_management.dart';
import 'package:http/http.dart';
import 'package:path/path.dart' as path;

void main() async {
Expand All @@ -85,7 +82,7 @@ void main() async {
// Upload a file
var file = File('some_file.png');
var attachment = await serviceManagement.servicedesk.attachTemporaryFile(
serviceDeskId: 1,
serviceDeskId: '1',
file: MultipartFile('file', file.openRead(), file.lengthSync(),
filename: path.basename(file.path)));

Expand Down
1 change: 0 additions & 1 deletion example/jira.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import 'dart:convert';
import 'package:atlassian_apis/jira_platform.dart';
import 'package:atlassian_apis/service_management.dart';

void main() async {
// Create Jira API from an authenticated client
Expand Down
1 change: 0 additions & 1 deletion example/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:io';
import 'package:atlassian_apis/jira_platform.dart';
import 'package:atlassian_apis/service_management.dart';

void main() async {
// This example uses API Token authentication.
Expand Down
3 changes: 1 addition & 2 deletions example/service_management.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import 'dart:convert';
import 'dart:io';
import 'package:atlassian_apis/service_management.dart';
import 'package:http/http.dart';
import 'package:path/path.dart' as path;

void main() async {
Expand All @@ -22,7 +21,7 @@ void main() async {
// Upload a file
var file = File('some_file.png');
var attachment = await serviceManagement.servicedesk.attachTemporaryFile(
serviceDeskId: 1,
serviceDeskId: '1',
file: MultipartFile('file', file.openRead(), file.lengthSync(),
filename: path.basename(file.path)));

Expand Down
48 changes: 48 additions & 0 deletions lib/src/generated/admin_organization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,20 @@ class AdminOrganizationApi {
},
));
}

/// Validate a policy based on specific requirements. For example, Trigger
/// CDEN validation by pushing a task into the SQS dns-validation queue
Future<void> validatePolicy(
{required String orgId, required String policyId}) async {
await _client.send(
'get',
'orgs/{orgId}/policies/{policyId}/validate',
pathParameters: {
'orgId': orgId,
'policyId': policyId,
},
);
}
}

/// Applicable when policy type is `ip-allowlist` or `data-residency`
Expand Down Expand Up @@ -646,6 +660,40 @@ class DomainPage {
}
}

/// CDEN policy validation failed
class ErrorCdenPolicyValidationFailedModel {
final List<ApplicationError> errors;

ErrorCdenPolicyValidationFailedModel({List<ApplicationError>? errors})
: errors = errors ?? [];

factory ErrorCdenPolicyValidationFailedModel.fromJson(
Map<String, Object?> json) {
return ErrorCdenPolicyValidationFailedModel(
errors: (json[r'errors'] as List<Object?>?)
?.map((i) => ApplicationError.fromJson(
i as Map<String, Object?>? ?? const {}))
.toList() ??
[],
);
}

Map<String, Object?> toJson() {
var errors = this.errors;

final json = <String, Object?>{};
json[r'errors'] = errors.map((i) => i.toJson()).toList();
return json;
}

ErrorCdenPolicyValidationFailedModel copyWith(
{List<ApplicationError>? errors}) {
return ErrorCdenPolicyValidationFailedModel(
errors: errors ?? this.errors,
);
}
}

/// Domain not found
class ErrorDomainNotFoundModel {
final List<ApplicationError> errors;
Expand Down
48 changes: 46 additions & 2 deletions lib/src/generated/confluence.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3161,7 +3161,7 @@ class SearchApi {
///
/// Note that some user fields may be set to null depending on the user's
/// privacy settings.
/// These are: email, profilePicture, and displayName.
/// These are: email, profilePicture, displayName, and timeZone.
Future<SearchPageResponseSearchResult> searchUser(
{required String cql,
int? start,
Expand Down Expand Up @@ -5582,6 +5582,13 @@ class BulkUserLookup {
/// The display name of the user. Depending on the user's privacy setting,
/// this may be the same as publicName.
final String displayName;

/// This display user time zone. Depending on the user's privacy setting, this
/// may be default to tenant time zone.
final String? timeZone;

/// Whether the user is an external collaborator user
final bool isExternalCollaborator;
final List<OperationCheckResult> operations;
final UserDetails? details;
final Space? personalSpace;
Expand All @@ -5598,12 +5605,15 @@ class BulkUserLookup {
required this.publicName,
required this.profilePicture,
required this.displayName,
this.timeZone,
bool? isExternalCollaborator,
List<OperationCheckResult>? operations,
this.details,
this.personalSpace,
required this.expandable,
required this.links})
: operations = operations ?? [];
: isExternalCollaborator = isExternalCollaborator ?? false,
operations = operations ?? [];

factory BulkUserLookup.fromJson(Map<String, Object?> json) {
return BulkUserLookup(
Expand All @@ -5617,6 +5627,8 @@ class BulkUserLookup {
profilePicture: Icon.fromJson(
json[r'profilePicture'] as Map<String, Object?>? ?? const {}),
displayName: json[r'displayName'] as String? ?? '',
timeZone: json[r'timeZone'] as String?,
isExternalCollaborator: json[r'isExternalCollaborator'] as bool? ?? false,
operations: (json[r'operations'] as List<Object?>?)
?.map((i) => OperationCheckResult.fromJson(
i as Map<String, Object?>? ?? const {}))
Expand Down Expand Up @@ -5645,6 +5657,8 @@ class BulkUserLookup {
var publicName = this.publicName;
var profilePicture = this.profilePicture;
var displayName = this.displayName;
var timeZone = this.timeZone;
var isExternalCollaborator = this.isExternalCollaborator;
var operations = this.operations;
var details = this.details;
var personalSpace = this.personalSpace;
Expand All @@ -5665,6 +5679,10 @@ class BulkUserLookup {
json[r'publicName'] = publicName;
json[r'profilePicture'] = profilePicture.toJson();
json[r'displayName'] = displayName;
if (timeZone != null) {
json[r'timeZone'] = timeZone;
}
json[r'isExternalCollaborator'] = isExternalCollaborator;
json[r'operations'] = operations.map((i) => i.toJson()).toList();
if (details != null) {
json[r'details'] = details.toJson();
Expand All @@ -5687,6 +5705,8 @@ class BulkUserLookup {
String? publicName,
Icon? profilePicture,
String? displayName,
String? timeZone,
bool? isExternalCollaborator,
List<OperationCheckResult>? operations,
UserDetails? details,
Space? personalSpace,
Expand All @@ -5702,6 +5722,9 @@ class BulkUserLookup {
publicName: publicName ?? this.publicName,
profilePicture: profilePicture ?? this.profilePicture,
displayName: displayName ?? this.displayName,
timeZone: timeZone ?? this.timeZone,
isExternalCollaborator:
isExternalCollaborator ?? this.isExternalCollaborator,
operations: operations ?? this.operations,
details: details ?? this.details,
personalSpace: personalSpace ?? this.personalSpace,
Expand Down Expand Up @@ -18074,6 +18097,10 @@ class User {
/// this may be the same as publicName.
final String? displayName;

/// This display user time zone. Depending on the user's privacy setting, this
/// may be default to tenant time zone.
final String? timeZone;

/// Whether the user is an external collaborator user
final bool isExternalCollaborator;

Expand All @@ -18095,6 +18122,7 @@ class User {
this.publicName,
this.profilePicture,
this.displayName,
this.timeZone,
bool? isExternalCollaborator,
bool? externalCollaborator,
List<OperationCheckResult>? operations,
Expand All @@ -18121,6 +18149,7 @@ class User {
? Icon.fromJson(json[r'profilePicture']! as Map<String, Object?>)
: null,
displayName: json[r'displayName'] as String?,
timeZone: json[r'timeZone'] as String?,
isExternalCollaborator: json[r'isExternalCollaborator'] as bool? ?? false,
externalCollaborator: json[r'externalCollaborator'] as bool? ?? false,
operations: (json[r'operations'] as List<Object?>?)
Expand Down Expand Up @@ -18154,6 +18183,7 @@ class User {
var publicName = this.publicName;
var profilePicture = this.profilePicture;
var displayName = this.displayName;
var timeZone = this.timeZone;
var isExternalCollaborator = this.isExternalCollaborator;
var externalCollaborator = this.externalCollaborator;
var operations = this.operations;
Expand Down Expand Up @@ -18188,6 +18218,9 @@ class User {
if (displayName != null) {
json[r'displayName'] = displayName;
}
if (timeZone != null) {
json[r'timeZone'] = timeZone;
}
json[r'isExternalCollaborator'] = isExternalCollaborator;
json[r'externalCollaborator'] = externalCollaborator;
json[r'operations'] = operations.map((i) => i.toJson()).toList();
Expand Down Expand Up @@ -18216,6 +18249,7 @@ class User {
String? publicName,
Icon? profilePicture,
String? displayName,
String? timeZone,
bool? isExternalCollaborator,
bool? externalCollaborator,
List<OperationCheckResult>? operations,
Expand All @@ -18233,6 +18267,7 @@ class User {
publicName: publicName ?? this.publicName,
profilePicture: profilePicture ?? this.profilePicture,
displayName: displayName ?? this.displayName,
timeZone: timeZone ?? this.timeZone,
isExternalCollaborator:
isExternalCollaborator ?? this.isExternalCollaborator,
externalCollaborator: externalCollaborator ?? this.externalCollaborator,
Expand Down Expand Up @@ -19231,6 +19266,7 @@ class WatchUser {
final String accountId;
final Icon profilePicture;
final String displayName;
final String? timeZone;
final List<OperationCheckResult> operations;
final bool isExternalCollaborator;
final UserDetails? details;
Expand All @@ -19247,6 +19283,7 @@ class WatchUser {
required this.accountId,
required this.profilePicture,
required this.displayName,
this.timeZone,
required this.operations,
required this.isExternalCollaborator,
this.details,
Expand All @@ -19265,6 +19302,7 @@ class WatchUser {
profilePicture: Icon.fromJson(
json[r'profilePicture'] as Map<String, Object?>? ?? const {}),
displayName: json[r'displayName'] as String? ?? '',
timeZone: json[r'timeZone'] as String?,
operations: (json[r'operations'] as List<Object?>?)
?.map((i) => OperationCheckResult.fromJson(
i as Map<String, Object?>? ?? const {}))
Expand All @@ -19289,6 +19327,7 @@ class WatchUser {
var accountId = this.accountId;
var profilePicture = this.profilePicture;
var displayName = this.displayName;
var timeZone = this.timeZone;
var operations = this.operations;
var isExternalCollaborator = this.isExternalCollaborator;
var details = this.details;
Expand All @@ -19309,6 +19348,9 @@ class WatchUser {
json[r'accountId'] = accountId;
json[r'profilePicture'] = profilePicture.toJson();
json[r'displayName'] = displayName;
if (timeZone != null) {
json[r'timeZone'] = timeZone;
}
json[r'operations'] = operations.map((i) => i.toJson()).toList();
json[r'isExternalCollaborator'] = isExternalCollaborator;
if (details != null) {
Expand All @@ -19329,6 +19371,7 @@ class WatchUser {
String? accountId,
Icon? profilePicture,
String? displayName,
String? timeZone,
List<OperationCheckResult>? operations,
bool? isExternalCollaborator,
UserDetails? details,
Expand All @@ -19344,6 +19387,7 @@ class WatchUser {
accountId: accountId ?? this.accountId,
profilePicture: profilePicture ?? this.profilePicture,
displayName: displayName ?? this.displayName,
timeZone: timeZone ?? this.timeZone,
operations: operations ?? this.operations,
isExternalCollaborator:
isExternalCollaborator ?? this.isExternalCollaborator,
Expand Down
Loading