od

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package od contains offer decisiong related functions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package od contains offer decisiong related functions.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// ActivitySchema references the activity schema
	ActivitySchema = "https://ns.adobe.com/experience/offer-management/offer-activity" //;version=0.5
	// TagSchema references the tag schema
	TagSchema = "https://ns.adobe.com/experience/offer-management/tag" // ;version=0.1
	// CollectionSchema references the collection schema
	CollectionSchema = "https://ns.adobe.com/experience/offer-management/offer-filter" //;version=0.2
	// PlacementSchema references the placement schema
	PlacementSchema = "https://ns.adobe.com/experience/offer-management/offer-placement" //;version=0.4
	// OfferSchema references the offer schema
	OfferSchema = "https://ns.adobe.com/experience/offer-management/personalized-offer" //;version=0.6
	// FallbackSchema references the fallback schema
	FallbackSchema = "https://ns.adobe.com/experience/offer-management/fallback-offer" //;version=0.1
	// RuleSchema references the rule schema
	RuleSchema = "https://ns.adobe.com/experience/offer-management/eligibility-rule" // ;version=0.3
)

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, p *api.AuthenticationConfig, containerID, schema string, obj interface{}) (interface{}, error)

Create creates a new object

func Delete

func Delete(ctx context.Context, p *api.AuthenticationConfig, containerID, id string) error

Delete deletes the object with the passed id

func List

func List(ctx context.Context, p *api.AuthenticationConfig, param *ListParam) (interface{}, error)

func ListContainer

func ListContainer(ctx context.Context, p *api.AuthenticationConfig) (interface{}, error)

ListContainer returns a list of container

func ListP added in v0.3.2

func ListP(ctx context.Context, p *api.AuthenticationConfig, req *api.Request) (interface{}, error)

List lists all objects

func Patch

func Patch(ctx context.Context, p *api.AuthenticationConfig, containerID, id, schema string, ops ...*UpdateOperation) (interface{}, error)

Patch patches the object with the passed id

Types

type Activity

type Activity struct {
	Name      string              `json:"xdm:name" yaml:"name"`
	StartDate string              `json:"xdm:startDate" yaml:"startDate"`
	EndDate   string              `json:"xdm:endDate" yaml:"endDate"`
	Status    string              `json:"xdm:status" yaml:"status"`
	Criteria  []*ActivityCriteria `json:"xdm:criteria" yaml:"criteria"`
	Fallback  string              `json:"xdm:fallback" yaml:"fallback"`
}

Activity contains the logic that informs the selection of an offer

type ActivityCriteria

type ActivityCriteria struct {
	Placements []string `json:"xdm:placements" yaml:"placements"`
	Selection  struct {
		Filter string `json:"xdm:filter" yaml:"filter"`
	} `json:"xdm:optionSelection" yaml:"selection"`
}

ActivityCriteria contains the criteria of an activity

type Collection

type Collection struct {
	Name   string   `json:"xdm:name" yaml:"name"`
	Filter string   `json:"xdm:filterType" yaml:"filter"`
	IDs    []string `json:"xdm:ids" yaml:"ids"`
}

Collection filters a set of offers

type Fallback

type Fallback struct {
	Name            string                 `json:"xdm:name" yaml:"name"`
	Status          string                 `json:"xdm:status" yaml:"status"`
	Representations []*OfferRepresentation `json:"xdm:representations" yaml:"representations"`
	Tags            []string               `json:"xdm:tags,omitempty" yaml:"tags,omitempty"`
	Attributes      map[string]string      `json:"xdm:characteristics,omitempty" yaml:"attributes,omitempty"`
}

Fallback represents a default offer

type ListParam added in v0.3.2

type ListParam struct {
	ContainerID string
	Schema      string
}

func (*ListParam) Request added in v0.3.2

func (p *ListParam) Request() *api.Request

type Offer

type Offer struct {
	Name            string                 `json:"xdm:name" yaml:"name"`
	Status          string                 `json:"xdm:status" yaml:"status"`
	Representations []*OfferRepresentation `json:"xdm:representations" yaml:"representations"`
	Constraint      *OfferConstraint       `json:"xdm:selectionConstraint" yaml:"constraint"`
	Rank            struct {
		Priority int `json:"xdm:priority" yaml:"priority"`
	} `json:"xdm:rank" yaml:"rank"`
	Capping *struct {
		Global int `json:"xdm:globalCap,omitempty" yaml:"global,omitempty"`
	} `json:"xdm:cappingConstraint,omitempty" yaml:"capping,omitempty"`
	Tags       []string          `json:"xdm:tags,omitempty" yaml:"tags,omitempty"`
	Attributes map[string]string `json:"xdm:characteristics,omitempty" yaml:"attributes,omitempty"`
}

Offer is a customizable marketing message based on eligibility rules and constraints

type OfferComponent

type OfferComponent struct {
	Name      string   `json:"repo:name" yaml:"name"`
	Type      string   `json:"@type" yaml:"type"`
	Format    string   `json:"dc:format" yaml:"format"`
	Content   string   `json:"xdm:content,omitempty" yaml:"content,omitempty"`
	URL       string   `json:"xdm:deliveryURL,omitempty" yaml:"url,omitempty"`
	Link      string   `json:"xdm:linkURL,omitempty" yaml:"link,omitempty"`
	Languages []string `json:"dc:language" yaml:"language"`
}

OfferComponent contains the content of the offer

type OfferConstraint

type OfferConstraint struct {
	StartDate string `json:"xdm:startDate" yaml:"startDate"`
	EndDate   string `json:"xdm:endDate" yaml:"endDate"`
	Rule      string `json:"xdm:eligibilityRule" yaml:"rule"`
}

OfferConstraint contains the offer rule

type OfferRepresentation

type OfferRepresentation struct {
	Components []*OfferComponent `json:"xdm:components,omitempty" yaml:"components,omitempty"`
	Placement  string            `json:"xdm:placement" yaml:"placement"`
	Channel    string            `json:"xdm:channel,omitempty" yaml:"channel,omitempty"`
}

OfferRepresentation connects content and placement

type Placement

type Placement struct {
	Name        string `json:"xdm:name" yaml:"name"`
	Content     string `json:"xdm:componentType" yaml:"content"`
	Channel     string `json:"xdm:channel" yaml:"channel"`
	Description string `json:"xdm:description" yaml:"description"`
}

Placement is a container that is used to showcase your offers

type Rule

type Rule struct {
	Name        string         `json:"xdm:name" yaml:"name"`
	Description string         `json:"xdm:description" yaml:"description"`
	Condition   *RuleCondition `json:"condition" yaml:"condition"`
	On          *RuleDefinedOn `json:"xdm:definedOn" yaml:"on"`
}

Rule is used to determine eligibility

type RuleCondition

type RuleCondition struct {
	Type   string `json:"type" yaml:"type"`
	Format string `json:"format" yaml:"format"`
	Value  string `json:"value" yaml:"value"`
}

RuleCondition contains the definition of the rule

type RuleDefinedOn

type RuleDefinedOn struct {
	Profile *RuleProfile `json:"profile" yaml:"profile"`
}

RuleDefinedOn ...

type RuleProfile

type RuleProfile struct {
	Schema *RuleVersionedSchema `json:"xdm:schema" yaml:"schema"`
	Paths  []string             `json:"xdm:referencePaths" yaml:"paths"`
}

RuleProfile ...

type RuleVersionedSchema

type RuleVersionedSchema struct {
	Ref     string `json:"$ref" yaml:"ref"`
	Version string `json:"version" yaml:"version"`
}

RuleVersionedSchema ...

type Tag

type Tag struct {
	Name string `json:"xdm:name" yaml:"name"`
}

Tag allow you to better organize and sort through your offers

type Update

type Update struct {
	IDs   []string           `json:"ids" yaml:"ids"`
	Apply []*UpdateOperation `json:"apply" yaml:"apply"`
}

Update is used for file based updates

type UpdateOperation

type UpdateOperation struct {
	Operation string `json:"op" yaml:"op"`
	Path      string `json:"path" yaml:"path"`
	Value     string `json:"value" yaml:"value"`
}

UpdateOperation defines the update operation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL