Skip to content

Commit

Permalink
Merge pull request #9 from Niurmiguel/development
Browse files Browse the repository at this point in the history
[REF] perform actions implemented
  • Loading branch information
Niurmiguel authored Jun 17, 2022
2 parents 40daf4c + bc8ec8e commit c6d5cca
Show file tree
Hide file tree
Showing 125 changed files with 1,215 additions and 363 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.14.0
19 changes: 19 additions & 0 deletions lib/client/services/adRule/adRule.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Represents the actions that can be performed on AdRule objects.
*/
export abstract class AdRuleAction {}

/**
* The action used for resuming AdRule objects.
*/
export class ActivateAdRules implements AdRuleAction {}

/**
* The action used for pausing AdRule objects.
*/
export class DeactivateAdRules implements AdRuleAction {}

/**
* The action used for deleting AdRule objects.
*/
export class DeleteAdRules implements AdRuleAction {}
5 changes: 3 additions & 2 deletions lib/client/services/adRule/adRule.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { Client } from 'soap';
import { AdRuleServiceOperations } from './adRuleService.interface';
import { Statement, UpdateResult } from '../../../common/types';
import { AdSpot, AdSpotPage } from './adSpot.type';
import { AdRule, AdRulePage, BreakTemplate, BreakTemplatePage, AdRuleAction } from './adRule.type';
import { AdRule, AdRulePage, BreakTemplate, BreakTemplatePage } from './adRule.type';
import { AdRuleAction } from './adRule.action';

export class AdRuleService implements AdRuleServiceOperations {
private _client: Client;
Expand Down Expand Up @@ -46,7 +47,7 @@ export class AdRuleService implements AdRuleServiceOperations {
return this._client.performAdRuleAction({
adRuleAction: {
attributes: {
'xsi:type': adRuleAction,
'xsi:type': adRuleAction.constructor.name,
},
},
filterStatement,
Expand Down
5 changes: 0 additions & 5 deletions lib/client/services/adRule/adRule.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,6 @@ export type BreakTemplate = {
breakTemplateMembers: BreakTemplateMember[];
};

/**
* Represents the actions that can be performed on AdRule objects.
*/
export type AdRuleAction = 'ActivateAdRules' | 'DeactivateAdRules' | 'DeleteAdRules';

/**
* Captures a page of {@link https://developers.google.com/ad-manager/api/reference/v202202/AdRuleService.AdRule AdRule} objects.
*/
Expand Down
3 changes: 2 additions & 1 deletion lib/client/services/adRule/adRuleService.interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Statement, UpdateResult } from '../../../common/types';
import { AdSpot, AdSpotPage } from './adSpot.type';
import { AdRule, BreakTemplate, AdRulePage, BreakTemplatePage, AdRuleAction } from './adRule.type';
import { AdRule, BreakTemplate, AdRulePage, BreakTemplatePage } from './adRule.type';
import { AdRuleAction } from './adRule.action';

/**
* Provides methods for creating, updating and retrieving AdRule objects.
Expand Down
14 changes: 14 additions & 0 deletions lib/client/services/adjustment/adjustment.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Represents the actions that can be performed on ForecastAdjustment objects.
*/
export abstract class ForecastAdjustmentAction {}

/**
* The action used for activating ForecastAdjustment objects.
*/
export class ActivateForecastAdjustments implements ForecastAdjustmentAction {}

/**
* DeactivateForecastAdjustments
*/
export class DeactivateForecastAdjustments implements ForecastAdjustmentAction {}
4 changes: 2 additions & 2 deletions lib/client/services/adjustment/adjustment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
ForecastAdjustmentPage,
TrafficForecastSegment,
TrafficForecastSegmentPage,
ForecastAdjustmentAction,
} from './adjustment.type';
import { ForecastAdjustmentAction } from './adjustment.action';

export class AdjustmentService implements AdjustmentServiceOperations {
private _client: Client;
Expand Down Expand Up @@ -57,7 +57,7 @@ export class AdjustmentService implements AdjustmentServiceOperations {
const res = this._client.performForecastAdjustmentAction({
forecastAdjustmentAction: {
attributes: {
'xsi:type': forecastAdjustmentAction,
'xsi:type': forecastAdjustmentAction.constructor.name,
},
},
filterStatement,
Expand Down
4 changes: 1 addition & 3 deletions lib/client/services/adjustment/adjustment.type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ForecastAdjustmentStatus, ForecastAdjustmentVolumeType } from './adjustment.enum';
import { DateRange, DateTime, PageResult } from '../../../common/types';
import { Targeting } from '../../common/types';
import { ForecastAdjustmentStatus, ForecastAdjustmentVolumeType } from './adjustment.enum';

/**
* Settings to specify daily ad opportunity counts that will be used as the expected future traffic volume for a forecast adjustment.
Expand Down Expand Up @@ -169,8 +169,6 @@ export type TrafficForecastSegment = {
creationDateTime: DateTime;
};

export type ForecastAdjustmentAction = 'ActivateForecastAdjustments' | 'DeactivateForecastAdjustments';

/**
* A page of **`ForecastAdjustmentDto`** objects.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Statement, UpdateResult } from '../../../common/types';
import { ForecastAdjustmentAction } from './adjustment.action';
import {
ForecastAdjustment,
ForecastAdjustmentAction,
ForecastAdjustmentPage,
TrafficForecastSegment,
TrafficForecastSegmentPage,
Expand Down
29 changes: 29 additions & 0 deletions lib/client/services/audienceSegment/audienceSegment.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Action that can be performed on {@link https://developers.google.com/ad-manager/api/reference/v202202/AudienceSegmentService.AudienceSegment AudienceSegment} objects.
*/
export abstract class AudienceSegmentAction {}

/**
* Action that can be performed on {@link https://developers.google.com/ad-manager/api/reference/v202202/AudienceSegmentService.FirstPartyAudienceSegment FirstPartyAudienceSegment} objects to activate them.
*/
export class ActivateAudienceSegments implements AudienceSegmentAction {}

/**
* Action that can be performed on {@link https://developers.google.com/ad-manager/api/reference/v202202/AudienceSegmentService.ThirdPartyAudienceSegment ThirdPartyAudienceSegment} objects to approve them.
*/
export class ApproveAudienceSegments implements AudienceSegmentAction {}

/**
* Action that can be performed on {@link https://developers.google.com/ad-manager/api/reference/v202202/AudienceSegmentService.FirstPartyAudienceSegment FirstPartyAudienceSegment} objects to deactivate them.
*/
export class DeactivateAudienceSegments implements AudienceSegmentAction {}

/**
* Action that can be performed on {@link https://developers.google.com/ad-manager/api/reference/v202202/AudienceSegmentService.FirstPartyAudienceSegment FirstPartyAudienceSegment} objects to populate them based on last 30 days of traffic.
*/
export class PopulateAudienceSegments implements AudienceSegmentAction {}

/**
* Action that can be performed on {@link https://developers.google.com/ad-manager/api/reference/v202202/AudienceSegmentService.ThirdPartyAudienceSegment ThirdPartyAudienceSegment} objects to reject them.
*/
export class RejectAudienceSegments implements AudienceSegmentAction {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Client } from 'soap';

import { AudienceSegmentServiceOperations } from './audienceSegmentService.interface';
import { Statement, UpdateResult } from '../../../common/types';
import { AudienceSegmentAction, AudienceSegmentPage, FirstPartyAudienceSegment } from './audienceSegment.type';
import { AudienceSegmentPage, FirstPartyAudienceSegment } from './audienceSegment.type';
import { AudienceSegmentAction } from './audienceSegment.action';

export class AudienceSegmentService implements AudienceSegmentServiceOperations {
private _client: Client;
Expand All @@ -25,7 +26,7 @@ export class AudienceSegmentService implements AudienceSegmentServiceOperations
return this._client.performAudienceSegmentAction({
action: {
attributes: {
'xsi:type': action,
'xsi:type': action.constructor.name,
},
},
filterStatement,
Expand Down
10 changes: 0 additions & 10 deletions lib/client/services/audienceSegment/audienceSegment.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,6 @@ export type FirstPartyAudienceSegment =
| NonRuleBasedFirstPartyAudienceSegment
| RuleBasedFirstPartyAudienceSegmentSummary;

/**
* Action that can be performed on {@link https://developers.google.com/ad-manager/api/reference/v202202/AudienceSegmentService.AudienceSegment AudienceSegment} objects.
*/
export type AudienceSegmentAction =
| 'ActivateAudienceSegments'
| 'ApproveAudienceSegments'
| 'DeactivateAudienceSegments'
| 'PopulateAudienceSegments'
| 'RejectAudienceSegments';

/**
* Represents a page of {@link https://developers.google.com/ad-manager/api/reference/v202202/AudienceSegmentService.AudienceSegment AudienceSegment} objects.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Statement, UpdateResult } from '../../../common/types';
import { AudienceSegmentAction, AudienceSegmentPage, FirstPartyAudienceSegment } from './audienceSegment.type';
import { AudienceSegmentAction } from './audienceSegment.action';
import { AudienceSegmentPage, FirstPartyAudienceSegment } from './audienceSegment.type';

/**
* Provides operations for creating, updating and retrieving
Expand Down
14 changes: 14 additions & 0 deletions lib/client/services/cdnConfiguration/cdnConfiguration.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Represents the actions that can be performed on {@link https://developers.google.com/ad-manager/api/reference/v202202/CdnConfigurationService.CdnConfiguration CdnConfiguration} objects.
*/
export abstract class CdnConfigurationAction {}

/**
* The action used for activating {@link https://developers.google.com/ad-manager/api/reference/v202202/CdnConfigurationService.CdnConfiguration CdnConfiguration} objects.
*/
export class ActivateCdnConfigurations implements CdnConfigurationAction {}

/**
* The action used for archiving {@link https://developers.google.com/ad-manager/api/reference/v202202/CdnConfigurationService.CdnConfiguration CdnConfiguration} objects.
*/
export class ArchiveCdnConfigurations implements CdnConfigurationAction {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CdnConfiguration, CdnConfigurationPage } from './cdnConfiguration.type';
import { CdnConfigurationAction } from './cdnConfiguration.action';
import { Statement, UpdateResult } from '../../../common/types';
import { CdnConfiguration, CdnConfigurationAction, CdnConfigurationPage } from './cdnConfiguration.type';

/**
* Provides methods for creating, updating and retrieving
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Client } from 'soap';

import { CdnConfigurationServiceOperations } from './cdnConfiguration.interface';
import { CdnConfiguration, CdnConfigurationPage } from './cdnConfiguration.type';
import { CdnConfigurationAction } from './cdnConfiguration.action';
import { Statement, UpdateResult } from '../../../common/types';
import { CdnConfiguration, CdnConfigurationAction, CdnConfigurationPage } from './cdnConfiguration.type';

export class CdnConfigurationService implements CdnConfigurationServiceOperations {
private _client: Client;
Expand All @@ -28,7 +29,7 @@ export class CdnConfigurationService implements CdnConfigurationServiceOperation
return this._client.performCdnConfigurationAction({
cdnConfigurationAction: {
attributes: {
'xsi:type': cdnConfigurationAction,
'xsi:type': cdnConfigurationAction.constructor.name,
},
},
filterStatement,
Expand Down
6 changes: 0 additions & 6 deletions lib/client/services/cdnConfiguration/cdnConfiguration.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ export type CdnConfiguration = {
cdnConfigurationStatus: CdnConfigurationStatus;
};

/**
* Represents the actions that can be performed on
* {@link https://developers.google.com/ad-manager/api/reference/v202202/CdnConfigurationService.CdnConfiguration CdnConfiguration} objects.
*/
export type CdnConfigurationAction = 'ActivateCdnConfigurations' | 'ArchiveCdnConfigurations';

/**
* Captures a page of {@link https://developers.google.com/ad-manager/api/reference/v202202/CdnConfigurationService.CdnConfiguration CdnConfiguration} objects.
*/
Expand Down
31 changes: 31 additions & 0 deletions lib/client/services/cmsMetadata/cmsMetadata.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Represents the actions that can be performed on
* {@link https://developers.google.com/ad-manager/api/reference/v202202/CmsMetadataService.CmsMetadataKey CmsMetadataKey} objects.
*/
export abstract class CmsMetadataKeyAction {}

/**
* The action used for activating {@link https://developers.google.com/ad-manager/api/reference/v202202/CmsMetadataService.CmsMetadataKey CmsMetadataKey} objects.
*/
export class ActivateCmsMetadataKeys implements CmsMetadataKeyAction {}

/**
* The action used for deactivating {@link https://developers.google.com/ad-manager/api/reference/v202202/CmsMetadataService.CmsMetadataKey CmsMetadataKey} objects.
*/
export class DeactivateCmsMetadataKeys implements CmsMetadataKeyAction {}

/**
* Represents the actions that can be performed on
* {@link https://developers.google.com/ad-manager/api/reference/v202202/CmsMetadataService.CmsMetadataValue CmsMetadataValue} objects.
*/
export abstract class CmsMetadataValueAction {}

/**
* The action used for activating {@link https://developers.google.com/ad-manager/api/reference/v202202/CmsMetadataService.CmsMetadataValue CmsMetadataValue} objects.
*/
export class ActivateCmsMetadataValues implements CmsMetadataValueAction {}

/**
* The action used for deactivating {@link https://developers.google.com/ad-manager/api/reference/v202202/CmsMetadataService.CmsMetadataValue CmsMetadataValue} objects.
*/
export class DeactivateCmsMetadataValues implements CmsMetadataValueAction {}
12 changes: 4 additions & 8 deletions lib/client/services/cmsMetadata/cmsMetadata.service.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { Client } from 'soap';

import { CmsMetadataKeyAction, CmsMetadataValueAction } from './cmsMetadata.action';
import { CmsMetadataServiceOperations } from './cmsMetadataService.interface';
import { CmsMetadataKeyPage, CmsMetadataValuePage } from './cmsMetadata.type';
import { Statement, UpdateResult } from '../../../common/types';
import {
CmsMetadataKeyAction,
CmsMetadataKeyPage,
CmsMetadataValueAction,
CmsMetadataValuePage,
} from './cmsMetadata.type';

export class CmsMetadataService implements CmsMetadataServiceOperations {
private _client: Client;
Expand Down Expand Up @@ -35,7 +31,7 @@ export class CmsMetadataService implements CmsMetadataServiceOperations {
return this._client.performCmsMetadataKeyAction({
cmsMetadataKeyAction: {
attributes: {
'xsi:type': cmsMetadataKeyAction,
'xsi:type': cmsMetadataKeyAction.constructor.name,
},
},
filterStatement,
Expand All @@ -49,7 +45,7 @@ export class CmsMetadataService implements CmsMetadataServiceOperations {
return this._client.performCmsMetadataValueAction({
cmsMetadataValueAction: {
attributes: {
'xsi:type': cmsMetadataValueAction,
'xsi:type': cmsMetadataValueAction.constructor.name,
},
},
filterStatement,
Expand Down
12 changes: 0 additions & 12 deletions lib/client/services/cmsMetadata/cmsMetadata.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ type CmsMetadataKey = {
status: CmsMetadataKeyStatus;
};

/**
* Represents the actions that can be performed on
* {@link https://developers.google.com/ad-manager/api/reference/v202202/CmsMetadataService.CmsMetadataKey CmsMetadataKey} objects.
*/
export type CmsMetadataKeyAction = 'ActivateCmsMetadataKeys' | 'DeactivateCmsMetadataKeys';

/**
* Captures a page of CMS metadata key objects.
*/
Expand All @@ -50,12 +44,6 @@ type CmsMetadataValue = {
status: CmsMetadataValueStatus;
};

/**
* Represents the actions that can be performed on
* {@link https://developers.google.com/ad-manager/api/reference/v202202/CmsMetadataService.CmsMetadataValue CmsMetadataValue} objects.
*/
export type CmsMetadataValueAction = 'ActivateCmsMetadataValues' | 'DeactivateCmsMetadataValues';

/**
* Captures a page of CMS metadata value objects.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { CmsMetadataKeyAction, CmsMetadataValueAction } from './cmsMetadata.action';
import { CmsMetadataKeyPage, CmsMetadataValuePage } from './cmsMetadata.type';
import { Statement, UpdateResult } from '../../../common/types';
import {
CmsMetadataKeyAction,
CmsMetadataKeyPage,
CmsMetadataValueAction,
CmsMetadataValuePage,
} from './cmsMetadata.type';

/**
* Provides methods for querying CMS metadata keys and values.
Expand Down
Loading

0 comments on commit c6d5cca

Please sign in to comment.